[...] 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.
My understanding is the LIST recursively interprets the string.
This sentence doesn't really make sense to me. I don't see any string
anywhere there.
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.
This is implementation-dependent. There's no reason it couldn't be
done as you outline. I'm not familiar with any that work that way, but
that means little, as the only one I really know that sort of detail
about is my own.
In my Lisp engine, evaluating (+ 1 2 3 4) first looks at the function
cell for the + symbol. Assuming it's the default, then, based on the
type of the object found there (a builtin function object of type
BIK_LAMBDA), the engine evaluates the arguments individually, then
calls the implementation code corresponding to that builtin function
object; that code loops through the evaluated arguments, keeping a
running total which is returned when it's done. There's no recursion
such as you describe involved.
/~\ 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