http://search.cpan.org/~ether/Devel-Declare-0.006019/lib/Devel/Declare.pm came *really* close to providing the proper kind of hook I was looking for, when my Macrame project encountered the limits of the naive parser in Filter::Simple. I couldn't quite make sense of the invocation mechanisms though. In general, the macro keyword would be sugar for introducing the new syntax; keeping consistent with the LALR parser makes circumfix macros (for some reason that seemed like an essential feature) even trickier -- when the closing token is not found within the compilation unit the tokens need to get returned to the token stream or the pointer backed up, or something -- complicated I don't remember. It seemed like a possible way forward would be to ditch YACC entirely and restate the actual language parsing in Perl -- towards this end I did reverse-engineer some state diagrams -- it seemed like after doing the extensive research exercise of actually delivering Perl parsed by Perl, the things that could be simplified into macros might become apparent -- for instance all the various loops could be formally normalized into c-style for loops by macros. On Sun, Jan 7, 2018 at 7:38 AM, Paul "LeoNerd" Evans <leonerd@leonerd.org.uk > wrote: > On Mon, 1 Jan 2018 16:35:30 -0600 > David Nicol <davidnicol@gmail.com> wrote: > > > I've always held, and continue to hold, that a well-defined macro > > language would be able to take care of having all the various styles > > (smartmatch and given/when are for purposes of this argument > > "styles") co-exist, by declaring a set of transforms that is so be > > applied to the current compilation unit before it gets instantiated > > into the executable format it eventually gets instantiated to. So I > > see macros operating at the same level as the "peephole optimizer." > > Mmmm macros. > > They're on my TODO list sometime after I get async/await nicely working. > > -- > Paul "LeoNerd" Evans > > leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS > http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/ > -- âno man should be compelled to do what the laws do not require; nor to refrain from acts which the laws permit.â Calder v. Bull (U.S. 1798)Thread Previous | Thread Next