The stately := operator feature proposal

Peter Williams pwil3058 at bigpond.net.au
Thu May 30 17:48:03 PDT 2013


On 30/05/13 18:43, Russel Winder wrote:
> On Thu, 2013-05-30 at 02:19 +0200, MrzlganeE wrote:
> […]
>> In places where I write a bunch of short mathy code, I do not
>> want to use 'auto'. The := operator would allow to declare a
>> variable, deduce its type, and define its value.
>>
>> void main() {
>>       x := 1;
>>       y := 2.0;
>>       z := x * y;
>>       y = 3.0;
>> }
> […]
>>
>>       for (i := 0; i < 24; i++) {
>>       }
>
> Go does exactly this, and it is good.
>
> Less is more.
>

Except in the case of Go with their inane policy of injecting ';' into 
the lexical analyser at the end of lines for the sake of brevity.

Peter


More information about the Digitalmars-d mailing list