DMD 1.005 release
Kevin Bealer
kevinbealer at gmai.com
Wed Feb 7 15:23:33 PST 2007
== Quote from Ivan Senji (ivan.senji_REMOVE_ at _THIS__gmail.com)'s article
> Andrei Alexandrescu (See Website For Email) wrote:
> > The ability to transform true code trees will come with D's macro
> > abilities. But that's a few months ahead at least.
>
> I can't believe that so many hours have passes since this post and no
> one has asked for some details?
I was going to, but I'm still righting the mental furniture that got flipped by
the last one.
Most of the template meta-stuff seems to be done using recursive patterns, (maybe
because it is easier to solve the "compile time halting problem" by limiting
recursive depth?)
So since parse trees are usually thought of as recursion friendly, I imagine it
would allow you to take a class as a template argument in the way that you can
currently take a tuple, and do either foreach or C[i..j] style processing of
fields, subclasses, etc.
A lower level abstraction would be to actually take a parse tree and just hand it
to you, and you could iterate over it, something like casting a "char[][int]*" to
"AA*". But this kind of low level approach would mean the compiler would forever
need to support the same parse tree layouts, which is undesireable.
I guess the question depends on how people actually use this kind of thing; how do
people use LISP macros in real world code? It's sort of a language-writing
language, but for some reason its hard to find non-toy examples. (On the other
hand, when I do its hard to read them.)
Kevin
More information about the Digitalmars-d-announce
mailing list