What are AST Macros?

Ellery Newcomer ellery-newcomer at utulsa.edu
Sun Jul 11 17:04:06 PDT 2010


On 07/11/2010 06:57 PM, retard wrote:
> Sun, 11 Jul 2010 22:03:56 +0000, pillsy wrote:
>
>> == Quote from Don (nospam at nospam.com)'s article
>>
>>> Philippe Sigaud wrote:
>> [...]
>>>> String mixins sure are powerful, but I can't get ird of a feeling of
>>>> 'cheating' when using them. Maybe with some kind of string
>>>> interpolation they could be made more palatable to some?
>>
>>> There's little doubt that it's the part of the language which needs the
>>> most attention in the long term. But the way forward is not at all
>>> obvious. So it's been deferred.
>>
>> I'm not clear on how one is supposed to go about making the equivalent
>> of hygienic macros using just string mixins and CTFE.
>
> You can create a trial-and-error gensym function with compile time
> introspection and CTFE/templates. :o) It's very elegant. CTFE solves all
> your AST macro use cases.

Wrong. The correct answer is magic.


More information about the Digitalmars-d mailing list