The reason you have to do this in lisp is because lisp has no syntax to speak of, and if you actually want any you need to roll it yourself. (Not, mind, that you can actually get syntax with macros, since a macro-ized lisp program is still a lisp program)
You'll have access to the AST the perl parser generates, and can manipulate it as you see fit before it goes to the compiler, though you'll find, I think, that you'll want (and have) to do this far less often in perl than you might in lisp.
Also be aware that this will be one of the features you'll most want to kill someone for using, if someone actually uses it. With great power comes great fuck-ups. (This is true in the Lisp community as well, which should be very, very worrisome. There are very few non-uber-hackers in the lisp world, as that sort of folk use other, more useful and less painful languages. And if the scary-smart people mess it up, well...)
If past history is anything to go by, the first word you should utter when you hear someone say "I can mess with the parse tree!" is... Don't!
In reply to Re: Parse-Tree Macros : from LISP to Perl 6?
by Elian
in thread Parse-Tree Macros : from LISP to Perl 6?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |