The Tail Operator '#' enables clean typechecked builders with minimal language changes.
Kagamin
spam at here.lot
Fri Jan 25 08:33:51 UTC 2019
On Friday, 25 January 2019 at 07:24:10 UTC, FeepingCreature wrote:
> But with the tail operator, this becomes:
>
> Foo.build
> #.a = 3
> #.b = 4
> #.c = 5
> #.value;
>
> Which is pure, typechecked, easy to extend and still readable.
>
> What do you think?
This is shorter and cleaner:
Foo.build
.a(3)
.b(4)
.c(5)
.value;
More information about the Digitalmars-d
mailing list