I want user to be able to input like this:
5+6*t+sin(2*t)
, so it will get converted to this:
(+ 5 (* 6 t) (sin (* 2 t)))
, so I can eval it to some function that will be JITted and executed efficiently later.
Are there already available libraries (with operator priorities) that works in up-to-date Clojure already?
the Incanter package include a module for doing infix math
user> ($= 7 + 8 - 2 * 6 / 2)
9
and others have written packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With