beautiful! Thx.
On 11 Mrz., 10:23, Benny Tsai wrote:
> (read-string) converts a string into a Clojure object, which can then be
> (eval)ed:
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
(read-string) converts a string into a Clojure object, which can then be
(eval)ed:
(let [f (eval (read-string "(fn [x] (* x 2))"))]
(map f [1 2 3]))
user=> (2 4 6)
So you could do something like:
(let [f (eval (read-string (slurp "function.txt")))]
(map f [1 2 3]))
--
You received this m