All variables have to be declared before use, this is what plug does as well. You should be able to just replace the variable names in the function definition inside the quote I’d imagine, to be something like this:
def websocket_handle({:json, unquote(matcher) = unquote(Macro.var(:json, nil))}, unquote(Macro.var(:state, nil))) do
Does that not work?


















