How can it be "reasonably functional" and yet "almost impossible to
write little test programs for"?
Obviously it will parse an arbitrarily complex arithmetical expression,
any halfway competent C programmer can knock that up in a few minutes.
The tricky thing is the lambda
This is a trivial function.
(set (quote foo) (lambda (x y z) (+(* x y) z)) )
so you can't eyeball that and make sure it's right. It's not entirely intuitive
to a human which brackets are needed and which aren't.
So far we're not doing anything that C can't, obviously we need a stack for
scoping x, y, and z, a hunk of code but not too bad.
But the snag is that functions are first class objects, as are lists. So
we can assign to foo(). We can do (set (quote fred) (y x z))
then
( set (quote foo) (lambda fred ( + (* x y) (z) ) )
Should the list that fred is set to have been quoted? How should the interpreter
behave if it hasn't been? How do we cycle fred through all three permutations
of x, y, z by setting a b c to various values of x y z? The difficulty
blows up very quickly.
You very quickly lose track of what ought to be evaluated when, and what the
path through the interpreter ought to be. You can run the code through a
correct Lisp interpreter to check it, but that's sort of cheating. Trying
to work out what a group of expressions should evaluate to by reading Lisp
docs is a nightmare.