DIP 50 - AST macros

dennis luehring dl.soluz at gmx.net
Mon Nov 11 01:01:30 PST 2013


> One of our targets for AST macros should be the ability to
> replicate roughly linq from c# / .net.
>
> An example syntax for use with AST could be:
>
> auto data = [5, 7, 9];
> int[] data2;
> query {
>    from value in data
>    where value >= 6
>    add to data2
> }
>
> Could be unwrapped to:
>
> auto data = [5, 7, 9];
> int[] data2;
> foreach(value; data) {
>    if (value >= 6) data2 ~= value;
> }

could you add the example to the DIP wiki page



More information about the Digitalmars-d mailing list