Just a nagging curiosity that I though someone could put an end to.
I seem to recall, quite a few years back, that edition 1 of Winston &
Horn's book on lisp always used to make reference to the language as
using functions.
Probably about 12 months after reading this library copy, I bought my
own (circa 1985-ish) - this time it was edition 2 by the same authors
and all of a sudden lisp had no functions!
looks as though some rebellious typesetter had issued a
1,$s/function/procedure/g command.
W+H edition 2 does state:
"A procedure that computes a value based only on its arguments is called
a function. Procedures are not functions if they have side effects."
For the short duration that I was taught lisp, I tended to be a little
obsessed with the 'pure' form of lisp - you know, the usual things:
I shunned side effects
avoided iterative statements
avoided setq like the plague
periodically foamed at the mouth ... :-)
In fact I seemed to get on without these things. My programs seemed to
work, albeit slowly, driven by a mixture of recursion and lambda
expressions.
So assuming lisp, unlike C, is relatively free of side effects - how
come it seems to have no functions? I tend to have some trouble in
accepting that:
(+ a b)
is not a function, but a predicate (as the book refers to it). What
manner of side effect could this possibly have?
--
Graham Coles | e-mail: ······@scitec.demon.co.uk
Sci-Tec Software | flames: ····@microsoft.com :)
In article <················@scitec.demon.co.uk>, I wrote:
<snip>
>So assuming lisp, unlike C, is relatively free of side effects - how
>come it seems to have no functions? I tend to have some trouble in
>accepting that:
> (+ a b)
>is not a function, but a predicate (as the book refers to it). What
^^^^^^^^^
Winston and Horn actually refer to it as as procedure because they pay
more attention to what they write than I do :-)
Thanks to those who e-mailed an explanation.
--
Graham Coles | e-mail: ······@scitec.demon.co.uk
Sci-Tec Software | flames: ····@microsoft.com :)