The stately := operator feature proposal

Timothee Cour thelastmammoth at gmail.com
Thu May 30 20:58:54 PDT 2013


I did... Earlier in that thread :)
On May 30, 2013 7:50 PM, "Dan Olson" <zans.is.for.cans at yahoo.com> wrote:

> "Diggory" <diggsey at googlemail.com> writes:
> >
> > 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
>
> Hmmm, why hasn't anybody just suggested doing this?  It seems to work
> fine in dmd.
>
>     auto
>         x = 23.5,
>         y = 14,
>         z = y*x,
>         s = "foo",
>         w = z * s.length;
>
> OR
>
>     immutable
>         x = 23.5,
>         y = 14,
>         z = y*x,
>         s = "foo",
>         w = z * s.length;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130530/abfbb44c/attachment.html>


More information about the Digitalmars-d mailing list