DIP 50 - AST macros

Jacob Carlborg doob at me.com
Thu Nov 21 00:31:17 PST 2013


On 2013-11-21 09:01, luka8088 wrote:

> When using q{} compiler treats the contents as a regular string, and you
> have to parse it and give it to the compiler using "mixin". So basically
> you can say to the compiler: this part of code is my DSL and I will
> parse it and check the semantics instead of you, then when I am done I
> will give you D AST represantation of it.
>
> The interpretation of the content of q{} is up to you, where in other
> proposals compiler builds AST based on, I would say, guessing.
>
> Take a look at this last example. And lets say that it is from python.
> In python dont2() belong inside else block. So how else would you make
> sure that compiler behaves accordingly?

Sorry, I meant your original suggestion of using t{}.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list