What are AST Macros?

Zach Tollen reachzach at gggmail.com
Fri Apr 6 21:45:45 UTC 2018


On Friday, 6 April 2018 at 21:23:00 UTC, Jonathan M Davis wrote:
> D does not have any kind of AST macros and likely never will. 
> Walter is completely against the idea - though I'd have to go 
> digging through newsgroup's history to find posts where he 
> talked about it to give the exact reasons. It's been a while 
> since they were discussed last, and I don't recall them at the 
> moment.

I think Walter's reason was that such macros would hide too many 
idiosyncrasies in how they were programmed, such that a lot of 
code which seems simple on the surface will actually obfuscate 
complicated and arbitrary macro-programming patterns. Thus, code 
that uses them will become much less maintainable, because it is 
liable to do so many different and hidden things. Also, the tasks 
for which AST-macros would typically be used are already largely 
accommodated by templates and other features. Thus, the real need 
for them isn't that high.



More information about the Digitalmars-d mailing list