I\'ve been working on Clojure question 135 Infix Calculator, basically a simplified infix to prefix arithmetic calculator:
(= 7 (__ 2 + 5))
I
you can use load-string
or read-string
. That's something like READ-FROM-STRING
in common lisp, which adhere to the principle of 'Code is Data', treats the string as codes - evaluate and return the value.
user=> (class (load-string "+"))
clojure.core$_PLUS_
user=> (read-string "+")
+
user=>
then you can simply use it.
Look at the resolve function
((resolve (symbol "+")) 1 2)