Fun with Macros

Rolf Langsdorf — 45 minutes 🐪

Implementing macros by using the use/import mecahnism

Macros are a killer feature of Lisp many have longed for Perl ...

... in fact, it has been possible for a long time to expand and "inline" a function at compile time.

All you need to do is to pair the import mechanism with a source filter so you can insert code cleanly without stepping into the usual trap of source filters.

Coupling that with Keyword::Simple you even have a macro mechanism at hand that works without a "use" statement.

To demonstrate the benefits, we will present various elegant solutions for DSLs, object models, and runtime optimization.



Talk tags
macros inlining sourcefilter
Perl versions
🐪 Perl 5
Target audience
Intermediate
Category
Perl 5 programming
Talk duration
45 minutes
Talk status
accepted
Related links

https://www.youtube.com/watch?v=7L9CegD8V-o