I enjoy common lisp, but sometimes it is really painful to input simple math expressions like
a(8b^2+1)+4bc(4b^2+1)
(Sure I can convert this, but it is kind of slow, I write (+ () ()) first, and then in each bracket I put (* () ())...)
I'm wondering if anyone here knows a better way to input this. I was thinking about writing a math macro, where
(math “a(8b^2+1)+4bc(4b^2+1)”)
expands to
(+ (* a (1+ (* 8 b b))) (* 4 b c (1+ (* 4 b b))))
but parsing is a problem for variables whose names are long.
Anybody has better suggestions?
There are reader macros for this purpose.
See: http://www.cliki.net/infix
For example:
'
is the usual quote.#I( some-infix-expression )
is the reader macro.