DIP 50 - AST macros

Walter Bright newshound2 at digitalmars.com
Mon Nov 18 01:27:29 PST 2013


On 11/18/2013 12:22 AM, Jacob Carlborg wrote:
> On 2013-11-17 21:52, Walter Bright wrote:
>
>> 1. I don't believe we can decide on language features by analogy. D is
>> complex enough that one can use analogy to justify anything.
>>
>> 2. You cannot do anything behind a function call - the 'return'
>> discussed earlier, and async/await for another, i.e. operator
>> overloading cannot introduce control flow, cannot introduce variables
>> into the current scope, etc.
>
> You can turn this:
>
> BigInt(3) + 7;
>
> Into something that is not 10.

That is not at all what I was talking about. I was talking about:

    3+7

being transformed by AST manipulation into something that is not 10.

> You cannot do anything behind a macro. You cannot introduce new syntax.





More information about the Digitalmars-d mailing list