DIP 50 - AST macros
Rikki Cattermole
alphaglosined at gmail.com
Mon Nov 11 01:52:06 PST 2013
On Monday, 11 November 2013 at 09:01:31 UTC, dennis luehring
wrote:
>> 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
Adding use case section with Linq example.
Please remove / modify as required as is first time editing wiki.
More information about the Digitalmars-d
mailing list