Remus

Namespace rswhite4 at googlemail.com
Wed Nov 7 23:32:45 PST 2012


On Thursday, 8 November 2012 at 03:21:03 UTC, bearophile wrote:
> Another interesting possible feature for Remus: as the usage of 
> immutable structs becomes more common in D code, it becomes 
> more useful a syntax to create an updated struct. Similar 
> syntax is present in F# and other functional languages.
>
> struct Foo { int first, second, third; }
> immutable f1 = Foo(10, 20, 30);
>
> Current syntax:
> immutable f2a = Foo(f1.first, 200, f1.third);
>
> A possible syntax:
> immutable f2b = Foo(f1 with second = 200);
>
> Bye,
> bearophile

That sounds like named parameters, which I don't like very much. 
:/


More information about the Digitalmars-d-announce mailing list