OT: Re: DConf Hackathon Ideas

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 28 03:09:32 PDT 2017


On Friday, 28 April 2017 at 09:52:29 UTC, Petar Kirov 
[ZombineDev] wrote:
>
> AST introspection - given a function definition (!= 
> declaration, i.e. the body is available) f, the expression 
> __traits(ast, f) should return an instance of FuncDeclaration 
> (https://github.com/dlang/dmd/blob/197ff0fd84b7b101f47458ab06e5b6f95959941e/src/ddmd/astnull.d#L151) with all of its members filled. The class-es used to represent the AST should be plain old data types (i.e. should contain no functionality). The AST as produced by the parser should be returned, without any semantic analysis (which can modify it). No backwards compatibility guarantees should be made about __traits(ast, f) at least for a couple of years.
>

This sounds interesting, but could you expand on what this 
enables/improves compared to CTFE+mixins?


More information about the Digitalmars-d mailing list