in reply to
Re: Re: Re: Re: A Macro System for Perl?
in thread A Macro System for Perl?
You really need to answer the question "What will I do with the macro system" before you have any hope of a design.
Some things, like the compile-time text transformation that C's preprocessor does, is best done with source filters, and at this point is both doable and pretty simple.
Fancier things, like adding new syntax (such as the switch statement or whatever) are best done by actually adding new syntax to the parser and compiler, putting it outside the realm of macros.
You might want to go ahead and mess with tokens--for example changing the definition of + for a lexical scope, but that's best done either by a change to the parser (and thus a change to the underlying language) or a change to the compiler's rules for tokens, both of which are best done in either the parser grammar language or by adding a few regexes and rules to the compiler. (Which, I suppose, could be considered macros of a sort, though I wouldn't)
So what do you want to do with the macros? Until you answer that, there's not much to be done to design the things.