Ignoring the fact that mutating vars like this is a bad idea, let's assume you really want to do it anyway. Your problem is two-fold:
- You have an unquote on
~tmp#
, where you just wanttmp#
- You're missing an unquote on
x
andy
: you want to(def ~x ~y)
and(def ~y tmp#)
The version you wrote always assigns to the vars named x
and y
, instead of modifying the vars provided by the user.