4 ms·
Common Lisp: http://abstractnonsense.com/math.html http://abstractnonsense.com/math.html It also handles function calls; sin(x) becomes (sin x). For example
by abstractbill 18y ago
Common Lisp: http://abstractnonsense.com/math.html http://abstractnonsense.com/math.html
It also handles function calls; sin(x) becomes (sin x). For example:
* (infix-to-prefix '(1 + sin(3 + x) * 42))
(+ 1 (* (SIN (+ 3 X)) 42))
If you want the input to be a string, just use read-from-string and add parens at each end of the input string.