The solution is to use ~'x and ~'y, but also to use gensyms for env (I
had tried ~'x, but still got the error from env which fooled me into
thinking ~'x did not work):
(defmacro my-env [& body]
`(fn [env#]
(let [~'x (env# :x)
~'y (env# :y)]
~@body)))
--
-asbjxrn