May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to MrzlganeE | On Thu, 30 May 2013 09:13:00 -0400, MrzlganeE <bulletproofchest@gmail.com> wrote:
> I hate you all, and with this, I exit the D community
>
I'll answer like I do my 2-year-old when HE throws tantrums.
That's OK, we still love you.
-Steve
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads | On Thursday, 30 May 2013 at 14:41:09 UTC, Byron Heads wrote:
> On Thursday, 30 May 2013 at 14:27:13 UTC, Russel Winder wrote:
>>
>> 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
could also be used without the type inference
int x;
x, string s := returnIntAndString();
------
int wx, wy;
...
wx, wy := window.position;
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On 05/30/2013 12:46 PM, Andrej Mitrovic wrote:
> On 5/30/13, Timon Gehr <timon.gehr@gmx.ch> wrote:
>> It is noticeable at a glimpse. It's simply a matter of getting
>> accustomed to new syntax.
>
> This depends on the person viewing the code. Don't forget not all
> people have 10/10 vision.
>
Those who don't usually use big enough font sizes anyway.
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to someone | On Thursday, 30 May 2013 at 14:55:38 UTC, someone wrote:
> 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)
I could be mistaken, but those languages don't have the notion of declaration, do they? (honest question)
Last time I tried a similar language, basically, any variable name that is not yet used is resolved to null. Which is why the syntax work.
D on the other hand has a strong notion of declaration, and construction.
I'm not sure it's just a matter of "messy syntax", and more of different paradigms. In D, it is more important to make the distinction of construction/assignment. The syntax is messy, but the new syntax blurs that line.
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | On Thursday, 30 May 2013 at 15:05:40 UTC, monarch_dodra wrote:
> On Thursday, 30 May 2013 at 14:55:38 UTC, someone wrote:
>> 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)
>
> I could be mistaken, but those languages don't have the notion of declaration, do they? (honest question)
>
> Last time I tried a similar language, basically, any variable name that is not yet used is resolved to null. Which is why the syntax work.
>
> D on the other hand has a strong notion of declaration, and construction.
>
> I'm not sure it's just a matter of "messy syntax", and more of different paradigms. In D, it is more important to make the distinction of construction/assignment. The syntax is messy, but the new syntax blurs that line.
There's another alternative that fits more with D style which is also very mathsy.
It would be possible to make storage classes work with the colon syntax, ie:
auto:
x = 1;
y = 2;
f = a => a+1
writeln(f(x) + y);
Also:
immutable:
x = 3;
y = 4;
Kind of like option explicit: off in VB
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Diggory Attachments:
| In this:
auto:
x = 1;
y = 2;
f = a => a+1
writeln(f(x) + y);
where do you delimit the end of the 'auto:' scope?
Actually this is already possible like that:
auto
x=1,
y=2;
On Thu, May 30, 2013 at 9:18 AM, Diggory <diggsey@googlemail.com> wrote:
> On Thursday, 30 May 2013 at 15:05:40 UTC, monarch_dodra wrote:
>
>> On Thursday, 30 May 2013 at 14:55:38 UTC, someone wrote:
>>
>>> 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)
>>>
>>
>> I could be mistaken, but those languages don't have the notion of declaration, do they? (honest question)
>>
>> Last time I tried a similar language, basically, any variable name that is not yet used is resolved to null. Which is why the syntax work.
>>
>> D on the other hand has a strong notion of declaration, and construction.
>>
>> I'm not sure it's just a matter of "messy syntax", and more of different paradigms. In D, it is more important to make the distinction of construction/assignment. The syntax is messy, but the new syntax blurs that line.
>>
>
> There's another alternative that fits more with D style which is also very mathsy.
>
> It would be possible to make storage classes work with the colon syntax, ie:
>
> auto:
> x = 1;
> y = 2;
> f = a => a+1
> writeln(f(x) + y);
>
> Also:
>
> immutable:
> x = 3;
> y = 4;
>
> Kind of like option explicit: off in VB
>
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | On Thursday, 30 May 2013 at 15:05:40 UTC, monarch_dodra wrote: > I could be mistaken, but those languages don't have the notion of declaration, do they? (honest question) > > Last time I tried a similar language, basically, any variable name that is not yet used is resolved to null. Which is why the syntax work. > FYI: MATLAB: >> x = linspace(0, 2*pi, 1000); y = sin(x); plot(x, y) >> disp(z) ??? Undefined function or variable 'z'. Python(IDLE): >>> print x Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> print x NameError: name 'x' is not defined |
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On Thursday, 30 May 2013 at 16:59:42 UTC, Timothee Cour wrote:
> In this:
> auto:
> x = 1;
> y = 2;
> f = a => a+1
> writeln(f(x) + y);
>
> where do you delimit the end of the 'auto:' scope?
At the end of the current scope - same rules as normal.
You can use { ... } to create a new scope where necessary.
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | > 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.
I have to uphold truth here because people on the newsgroups can believe you without being able to verify if you are telling the truth.
I've only been to the #D channel a few times, and I've only described a single problem there: (Difficulty static-allocating in-class). In a friendly talk I also said: (The gc world-stopping can be reorganized).
If you aren't flatly lying, then all you have to do is tell: What was the other issue I had? And post a snippet / log of it, or a link to a snippet/log. Or just remember what it was. You will not be able to do so.
|
May 30, 2013 Re: The stately := operator feature proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | On Thursday, 30 May 2013 at 15:05:40 UTC, monarch_dodra wrote:
> On Thursday, 30 May 2013 at 14:55:38 UTC, someone wrote:
>> 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)
> Last time I tried a similar language, basically, any variable name that is not yet used is resolved to null. Which is why the syntax work.
Not quite.
The paradigm in python/matlab etc. could be expressed as "initialisation is declaration". It works ok.
IDL (interactive data language, not interface description language) takes it to the next level by allowing undeclared variables to be passed as output parameters to a function. Which, combined with single return types and a strict separation of procedures and functions, each with different calling syntax, is horrible.
|
Copyright © 1999-2021 by the D Language Foundation