Works with unquote, cannot make it work with separate macro

Just a quick guess, but you are passing name to your function, and just yesterday we had the discussion about Macro.escape/2. So I’d try to escape name and value before passing them. I don’t know exactly thow, if you need to do it before calling the macro, or if you can do it inside of the macro (before quote-block).

Perhaps, it might also be, that you need to use Macro.expand/2. I’m always confused about how and when I need which of the functions from Macro module, so as soon as something doesn’t work without them randomly until it works, or I just change my plan and try to do something similar without using metaprogramming at all :wink:

1 Like