Moshe Zadka <[EMAIL PROTECTED]> writes:

> On Mon, 24 Jul 2000, Stanislav Malyshev a.k.a Frodo wrote:
> 
> > IA>> I was once told that in Scheme (and IANASP) an "if" statement is an
> > IA>> object in itself. I'll be learning scheme next year and be able to tell
> > 
> > Well, I don't know what for, but OK - I can imagine language where sytax
> > constructs are objects. Even makes me curious. Good book on Scheme,
> > anyone?

> SICP

SICP is excellent, more for general understanding of computing, but
you can learn scheme from it, no doubt.  For questions like this, I
would also recommend "On Lisp" by Paul Graham.

In Graham's language, lisp (or scheme) is a tool for buyilding
languages. If one thinks along these lines, the idea of a "language
construct" being no different from any other object does not seem
strange. As for practical meaning of all those "theoretical" ideas
such as "functions as first-class objects" etc, maybe I can dig up ...
oh, yes, here it is - saw it not so long ago on comp.lang.lisp:

http://x55.deja.com/threadmsg_ct.xp?AN=567662821.1&mhitnum=0&CONTEXT=964637726.1757806594

Back to "if" as an object. Actually, "if" is a rather bad example of
"language constructs as objects". It is a "special form", which means
that the evaluation rules for "if" differ from the general evaluation
rules for everithing else. SICP has a nice exercise explaining why if
cannot be implemented as a function (and thus an object) in terms of a
more basic special form "cond". So "if" is indeed special in scheme.

-- 
Oleg Goldshmidt <[EMAIL PROTECTED]> 
"... We work by wit, and not by witchcraft;
 And wit depends on dilatory time." [Shakespeare]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to