System programming in D (Was: The God Language)

Timon Gehr timon.gehr at gmx.ch
Fri Dec 30 20:02:30 PST 2011


On 12/31/2011 04:50 AM, Walter Bright wrote:
> On 12/30/2011 6:59 PM, Timon Gehr wrote:
>> On 12/31/2011 03:16 AM, Andrei Alexandrescu wrote:
>>> On 12/30/11 6:25 PM, Timon Gehr wrote:
>>>> I'd be happy to extend the system, but currently I don't see it fall
>>>> short any of the three requirements. Can you help me out?
>>>
>>> I think it would be great to reproduce the expansion semantics of ddoc.
>>>
>>> Andrei
>>
>> So basically, just breaking infinite recursion on recursive identical
>> instantiations?
>>
>> In what way does such a feature improve the expressiveness of the
>> macro system?
>
> Because inevitably someone will write:
>
> #define FOO a + FOO
>
> and expect it to work (the correct expansion would be "a + FOO", not a
> stack overflow). The C preprocessor works this way, as do makefile
> macros, as Ddoc does.

Makes sense, but why is it an issue if expansion is explicit?

enum FOO = q{a + FOO};

mixin(FOO);


More information about the Digitalmars-d mailing list