I am discussing closure with a friend and he thinks (partial + 5) is a closure. But I think a closure is a function closing over a free variable, for example
(let [a 10]
(defn func1 [x] (+ x a))
)
then func1 is a closure. But in this case 5 is not a free variable. So which is the right answer?
partialuses a closure to make the partial function. Check out the code ofpartialby using(source partial)in repl and you will see that it uses closures.