DIP 50 - AST macros

Dicebot public at dicebot.lv
Tue Nov 12 08:47:37 PST 2013


On Tuesday, 12 November 2013 at 16:39:18 UTC, Andrei Alexandrescu 
wrote:
> Maybe the problem needs to be reformulated for D. I think an 
> SQL mixin that either stays unchanged (for DB engines) or 
> translates to a D expression (for native D data types) would be 
> doable, nontrivial, interesting, and instantly usable for 
> people who already know SQL without any extra learning. In 
> other words... actually better than Linq.

It does not matter that much if it is macro or mixin. Key feature 
is AST reflection which allows to augment valid D code with 
additional semantics when appropriate. It is very similar to how 
UDA's augment declarative approach, but applied to 
imperative/procedural instead. We can't do that in D right now. 
Only way is to import own source file and parse it which does not 
really sound sane.


More information about the Digitalmars-d mailing list