What I'm trying to do is call a function from a map with some locally defined variables without expressing the whole variable in the call to the function.
For example, the following code works, :
(let [a [0 1 2]] (eval (list ({:fun 'count} :fun) a))) => 3 and this code works for a quoted 'a when it is globally defined:
(def a [0 1 2]) (eval (list ({:fun 'count} :fun) 'a)) but this code does not work:
(let [a [0 1 2]] (eval (list ({:fun 'count} :fun) 'a))) => Unable to resolve symbol: a in this context The first chunk is fine for small vectors like this one, but when I need to pass in a vector of several thousand items then the unquote "a" would cause it to throw an error for "Method too large" because the actual method sent to the machine is:
(let [a [0 1 2]] (eval (count [0 1 2])) What is a simple way to execute a call to the function with the variable itself as an argument?