Thanks so much, @jlapeyre and @Tamas_Papp - I’ll give the two approaches a try today, to see how they work.
They both look great although in the general case I believe that the macro approach could be more efficient as it won’t evaluate the input on every function call. Similar to Metaprogramming · The Julia Language
@Mason first-class macros would be awesome. It looks like lisp-style macros could be “upgraded” to first-class macros. I’d love to see that in Julia.