May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to MrzlganeE | Am 30.05.2013 13:41, schrieb MrzlganeE:
> x := 2 / pi*z;
> auto x = 2 / pi*z;
>
> z := column(i, x, diag);
> auto z = column(i, x, diag);
>
> I don't think it's worth it force all people to write the second form,
> over a theoretical nitpick that the programmer will possibly forget how
> interpret symbols.
>
> To me, 'auto' has a price. The price is a foreign word being inserted
> into my math. It's an invasive term. It ruins the beautiful expression.
>
> If you think the programmer is going to forget how to read symbols, you
> should consider both sides: "The programmer might forget how to read
> symbols, but also the programmer will be able to write declarative
> expressions involving just their own terms."
>
> It's not all bad, you see?
>
> I am trying to reach for an expressiveness which allows such a simple
> thing -- writing expressions that involve just my own terms: x. 2. pi.
> z. That's the feature!
>
> And allowing to make expressions with just my own terms is such a small
> change to the language, we are only inches away from that. It drives me
> crazy to be so close.
>
> auto x = 2 / pi*z; is like ketchup in my sushi, every time.
>
> Try to consider that people always oppose every single new thing. They
> would have said the array slices are not C-like enough, and that '..' is
> not in the C language and should not be used. But we have that great
> feature now because somebody decided not to be so conservative.
I disagree.
Given my Pascal background I have a special liking for ":=", and Go also makes use of ":=" in the form you propose.
However D's auto follows the way C++11 has decided for type inference which is the crowd that we want to bring to D. And not very different from var, also used for the same purpose in many other languages.
Additionally, we should avoid making D into a TIMTOWTDI language.
--
Paulo
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | I hate you all, and with this, I exit the D community The only reason I was here was I dreamed that I could get a couple of features |
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to MrzlganeE | Not gonna think about D, I got a big C++ codebase to deal with, a lot of work to do. D was just a dream. I will check the D website again in 3 years |
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to MrzlganeE | On Thu, 30 May 2013 14:13:00 +0100, MrzlganeE <bulletproofchest@gmail.com> wrote: > I hate you all, and with this, I exit the D community > > The only reason I was here was I dreamed that I could get a couple of features Over-react much? Bear in mind that everyone posting here is on equal footing and simply sharing opinions. The only people you really need to convince are Walter or Andrei, or someone else who is actually influential.. perhaps Don. You can safely ignore almost everyone else :p R -- Using Opera's revolutionary email client: http://www.opera.com/mail/ |
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to MrzlganeE | On 5/30/13, MrzlganeE <bulletproofchest@gmail.com> wrote:
> I hate you all, and with this, I exit the D community
>
> The only reason I was here was I dreamed that I could get a couple of features
This is the guy that trolls in #d on freenode under the name of Ndit. He describes a problem, and then screams how D is so much worse than other languages because of problem X, offering no backup evidence. And every day he comes up with some new complaint. I don't think we should take him seriously at all.
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Attachments:
| On Thu, 2013-05-30 at 15:54 +0200, Andrej Mitrovic wrote: > On 5/30/13, MrzlganeE <bulletproofchest@gmail.com> wrote: > > I hate you all, and with this, I exit the D community > > > > The only reason I was here was I dreamed that I could get a couple of features > > This is the guy that trolls in #d on freenode under the name of Ndit. He describes a problem, and then screams how D is so much worse than other languages because of problem X, offering no backup evidence. And every day he comes up with some new complaint. I don't think we should take him seriously at all. I still like: x := 1 for a declaration and initialization with type inference. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder |
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On Thursday, 30 May 2013 at 14:27:13 UTC, Russel Winder wrote:
> On Thu, 2013-05-30 at 15:54 +0200, Andrej Mitrovic wrote:
>> On 5/30/13, MrzlganeE <bulletproofchest@gmail.com> wrote:
>> > I hate you all, and with this, I exit the D community
>> >
>> > The only reason I was here was I dreamed that I could get a
>> > couple of features
>>
>> This is the guy that trolls in #d on freenode under the name of Ndit.
>> He describes a problem, and then screams how D is so much worse than
>> other languages because of problem X, offering no backup evidence. And
>> every day he comes up with some new complaint. I don't think we should
>> take him seriously at all.
>
> I still like:
>
> x := 1
>
> for a declaration and initialization with type inference.
This proposition is just a killer. Mixing a totally different syntactical meaning from modula or pascal into d. I don’t like that idea at all.
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On Thursday, 30 May 2013 at 14:27:13 UTC, Russel Winder wrote:
> On Thu, 2013-05-30 at 15:54 +0200, Andrej Mitrovic wrote:
>> On 5/30/13, MrzlganeE <bulletproofchest@gmail.com> wrote:
>> > I hate you all, and with this, I exit the D community
>> >
>> > The only reason I was here was I dreamed that I could get a
>> > couple of features
>>
>> This is the guy that trolls in #d on freenode under the name of Ndit.
>> He describes a problem, and then screams how D is so much worse than
>> other languages because of problem X, offering no backup evidence. And
>> every day he comes up with some new complaint. I don't think we should
>> take him seriously at all.
>
> I still like:
>
> x := 1
>
> for a declaration and initialization with type inference.
Could be used for assigning from tuples.
iVal, sVal := returnsIntAndString();
would have to decide on how to handle this
x := 1;
x := y * 7; // error or assignment?
more of an issue with tuples then single lvalues
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
On 5/30/13, Russel Winder <russel@winder.org.uk> wrote:
> I still like:
>
> x := 1
>
> for a declaration and initialization with type inference.
Well the saying goes, even a broken clock..
Personally I think it's way too late for such a feature. What if you make a typo and instead of declaring a new shadowed variable you end up modifying an existing one?
int x;
void main()
{
auto x = 5; // so far so good, it's obviously a new variable
}
vs:
int x;
void main()
{
x := 5;
}
which with a typo becomes:
int x;
void main()
{
x = 5;
}
Could you easily spot the bug?
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to MrzlganeE | Please think about the huge math and science community. Most of them I came across like D for its speed and efficiency. But D can never replace Matlab/Octave/Ipython/Scipy because .... .. of the messy syntax compared to almost math like syntax above languages offer. For example, if I want to quickly want to plot something, in Octave I would do: x = linspace(0, 2*pi, 1000); y = sin(x); plot(x, y) now, how to do that in D (assuming proper libs are already imported): auto x = linspace(0, 2*pi, 1000); auto y = sin(x); plot(x, y) the "auto" keyword seems to be a distraction. Compare it with the following code: x := linspace(0, 2*pi, 1000); y := sin(x); plot(x, y) For a code of several lines or 100s of lines auto becomes too much of a distraction. Especially when I want to quickly write a code to analyze some data I want the code to look like math as much as possible and not get distracted by too many language constructs. You can say that D was never designed for that purpose, well, too bad then. D has so much potential to replace python/octave/matlab for math/scientific computing. Please give this a thought before dismissing the idea. |
Copyright © 1999-2021 by the D Language Foundation