in reply to Pretending to be lisp: macros

Filter::Simple + Text::Balanced = macros
There's a macro module on cpan, seems too fresh though.

The advantage that Lisp macros have over most other non-lisp languages is that they can manipulate the syntax tree as a data structure. This would be like mixing B::Generate into the mix above.

Replies are listed 'Best First'.
Re^2: Pretending to be lisp: macros
by adrianh (Chancellor) on Sep 19, 2003 at 06:49 UTC
    The advantage that Lisp macros have over most other non-lisp languages is that they can manipulate the syntax tree as a data structure.

    And that is a hellishly large advantage.

    The problem with taking the filter approach in Perl 5 is that multiple filters don't play well together. Since they're based on purely textual substitutions the text that one filter expects can interfere with the expectations of another.

    If, however, everybody is dealing with syntax trees this problem disappears... one of the (many) reasons I'm looking forward to Perl6 :-)

      The only alternative to this in perl5 is B::Utils and B::Generate and you have to be a wizard to do anything with it. Uck.