Memoize Pkg? Bad use of Metaprogramming?

Yeah, that’s much better. I think the only thing you’re missing is that you need to escape the symbols provided to the macro, e.g. $(esc(var)) instead of $var. The section of the manual on macro hygiene has more info about escaping.

2 Likes