From: mouse at
rodents-montreal.org
The other part is that in LISP, the operation is
over a list.
(+ 4 5 6 ) in LISP is not same as 4 5 6 + in Forth.
Yes. Lisp does not quite use (non-reverse) Polish notation; it
surrounds calls with parens so as to support variable-arity functions.
(For example, most Lisps support not only (+ 1 2) but (+ 1 2 3) and
(+ 4 5 6 7) and the like, whereas FORTH does the analog with 1 2 + and
1 2 3 + + and 4 5 6 7 + + +). If all Lisp operations had fixed arity,
the parens could in principle be omitted in code, though that would
have two problems: (1) they are useful enough to humans that it would
arguably be a good idea to provide them anyway for error checking and
(2) it would break homoiconicity to some extent - even if the +
function always takes exactly two args, the list (+ 1 2 3 4 5) still
makes sense as a list, just one that errors if evaluated.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse at
rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
My understanding is the LIST recursively interprets the string.
It parses out the first part and the rest of the string. If the rest
is not atomic for add, it nest and repeats until it gets to two atomic
parts that it can apply + to. As it unwinds, it does the add of two
at a time.
Dwight