How to translate this Clojure code to Hy, so it prints 2?
It doesn't need to be like Clojure, i just want to hide +
and replace it with -
in local environment.
(defmacro q [expr]
`(let ~'[+ (fn [x y] (- x y))]
~expr))
(print (q (+ 3 1)))
In Clojure
it prints 2
(let creates a local environment).
In Hy
it prints 4
.
How to make Hy print 2
also, by replacing the +
with -
?
I need those local environments because i am making a DSL.