DIP 50 - AST macros

Walter Bright newshound2 at digitalmars.com
Sun Nov 17 12:52:17 PST 2013


On 11/17/2013 2:38 AM, Jacob Carlborg wrote:
> On 2013-11-17 10:00, Walter Bright wrote:
>
>> That would be better, but I don't think enough better.
>
> Then why to we have UDA's with the same syntax as language attributes and why do
> we have operator overloading.
>
> You can hide arbitrary code behind operator overloading.

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.



More information about the Digitalmars-d mailing list