The stately := operator feature proposal

John Colvin john.loughran.colvin at gmail.com
Thu May 30 11:00:56 PDT 2013


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.


More information about the Digitalmars-d mailing list