Re: Lisp history: IF, etc.

Liste des GroupesRevenir à cl lisp 
Sujet : Re: Lisp history: IF, etc.
De : enometh (at) *nospam* meer.net (Madhu)
Groupes : comp.lang.lisp
Date : 03. Apr 2024, 11:29:31
Autres entêtes
Organisation : Motzarella
Message-ID : <m3frw2vlok.fsf@leonis4.robolove.meer.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
* Alan Bawden <86h6gjpq3i.fsf_-_@williamsburg.bawden.org> :
Wrote on Tue, 02 Apr 2024 14:38:25 -0400:
I don't think that McCarthy invented IF as an abbreviation for COND, but
I could be wrong.  He certainly _could_ have invented it, but if he did,
it was forgotten by the mid 1970s.  Defining IF as a _personal_ macro was
common practice for 1970s Lisp programmers, and I don't think IF was
provided as standard by _any_ major Lisp implementation at that time.
(Maybe InterLisp did?  I don't recall, and I no longer have an InterLisp
manual on my bookshelf.)  Scheme had IF _instead_ of COND, but nobody
was using Scheme for anything serious yet.  And I don't think the T
project had started at that point.
>
In fact, when the Lisp Machine group decided to introduce a standard IF
macro into Lisp Machine Lisp, we were a bit worried that another
significant body of Lisp code was already using a slightly different
syntax for IF than the one we wanted to use.  Multics Emacs (written in
Multics MacLisp) had popularized an IF macro that used an ELSE keyword
somehow.  We negotiated a deal with the Multics guys (Bernie Greenberg)
where they agreed to change their IF to guarantee that an IF with no
ELSE keyword would work exactly the same way ours did.
>
This was perhaps the very beginning of the road that eventually led us
to Common Lisp.  A bunch of Lisp implementations (Lisp Machine Lisp, NIL
and both branches of MacLisp) all introduced a bunch of new syntax (IF,
LET, DEFSTRUCT, SETF, backquote, sharpsign, etc.) into their standard
environment so that individual programmers and programs no longer had to
define them themselves.
>
But I'd love to see evidence that McCarthy arrived at ternary IF before
anyone else.  He certainly invented COND, where the interesting thing
about COND was that it was an _expression_ rather than a statement, so
we often say that "McCarthy invented the conditional expression".  And
sometimes that gets shortened to "McCarthy invented the if-expression".
But I don't think that he ever literally wrote "(IF ...)" rather than
"(COND ...)".

I've forgotten the distinction between a statement and an expression in
lisp.  Maybe someone can remind me.  is it that IF is a special operator
but COND is a macro?  From the point of view of surface syntax, aren't
they the same sort of beast?  Both evaluate to a result which can be
uses elsewhere, so they can't be "statements" in the sense of other
programming languages.

I'm not even sure that McCarthy would have seen the advantage of IF over
COND given that what he originally wanted us all to write was actually
"[expr -> expr; expr]"!

CLHS has

 (if test-form then-form else-form)
 ==  (cond (test-form then-form) (t else-form))

so by inventing COND he had already invented IF, and probably felt
secure enough and not compelled publish another result



Date Sujet#  Auteur
2 Apr 24 * Lisp history: IF, etc.56Alan Bawden
2 Apr 24 +- Re: Lisp history: IF, etc.1Kaz Kylheku
3 Apr 24 +- Re: Lisp history: IF, etc.1Gijs Hillenius
3 Apr 24 +- Re: Lisp history: IF, etc.1Gijs Hillenius
3 Apr 24 +* Re: Lisp history: IF, etc.49Madhu
3 Apr 24 i`* Re: Lisp history: IF, etc.48Alan Bawden
3 Apr 24 i +* Re: Lisp history: IF, etc.35Paul Rubin
3 Apr 24 i i`* Re: Lisp history: IF, etc.34Alan Bawden
4 Apr 24 i i +* Re: Lisp history: IF, etc.32Paul Rubin
4 Apr 24 i i i+* Re: Lisp history: IF, etc.5Lawrence D'Oliveiro
4 Apr 24 i i ii+* Re: Lisp history: IF, etc.3Axel Reichert
4 Apr 24 i i iii+- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro
4 Apr 24 i i iii`- Re: Lisp history: IF, etc.1Paul Rubin
4 Apr 24 i i ii`- Re: Lisp history: IF, etc.1Kaz Kylheku
4 Apr 24 i i i`* Re: Lisp history: IF, etc.26Alan Bawden
5 Apr 24 i i i `* Re: Lisp history: IF, etc.25Paul Rubin
5 Apr 24 i i i  `* Re: Lisp history: IF, etc.24Julieta Shem
5 Apr 24 i i i   +- Re: Lisp history: IF, etc.1Julieta Shem
6 Apr 24 i i i   +- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro
15 Apr 24 i i i   `* Re: Lisp history: IF, etc.21Paul Rubin
16 Apr 24 i i i    `* Re: Lisp history: IF, etc.20Jeff Barnett
16 Apr 24 i i i     +* Re: Lisp history: IF, etc.2Lawrence D'Oliveiro
16 Apr 24 i i i     i`- Re: Lisp history: IF, etc.1Jeff Barnett
16 Apr 24 i i i     +* Re: Lisp history: IF, etc.16Paul Rubin
16 Apr 24 i i i     i`* Re: Lisp history: IF, etc.15Jeff Barnett
16 Apr 24 i i i     i `* Re: Lisp history: IF, etc.14Lawrence D'Oliveiro
16 Apr 24 i i i     i  +* Re: Lisp history: IF, etc.12Paul Rubin
17 Apr 24 i i i     i  i`* Re: Lisp history: IF, etc.11Lawrence D'Oliveiro
17 Apr 24 i i i     i  i `* Re: Lisp history: IF, etc.10Paul Rubin
17 Apr 24 i i i     i  i  `* Re: Lisp history: IF, etc.9Jeff Barnett
17 Apr 24 i i i     i  i   `* Re: Lisp history: IF, etc.8Lawrence D'Oliveiro
17 Apr 24 i i i     i  i    `* Re: Lisp history: IF, etc.7Paul Rubin
17 Apr 24 i i i     i  i     +* Re: Lisp history: IF, etc.3Madhu
18 Apr 24 i i i     i  i     i`* Re: Lisp history: IF, etc.2Lawrence D'Oliveiro
18 Apr 24 i i i     i  i     i `- Re: Lisp history: IF, etc.1Paul Rubin
17 Apr 24 i i i     i  i     `* Re: Lisp history: IF, etc.3Ben Bacarisse
18 Apr 24 i i i     i  i      `* Re: Lisp history: IF, etc.2Lawrence D'Oliveiro
18 Apr 24 i i i     i  i       `- Re: Lisp history: IF, etc.1Stefan Monnier
17 Apr 24 i i i     i  `- Re: Lisp history: IF, etc.1Jeff Barnett
17 Apr 24 i i i     `- Re: Lisp history: IF, etc.1Stefan Ram
4 Apr 24 i i `- Re: Lisp history: IF, etc.1Ben Bacarisse
3 Apr 24 i +* Re: Lisp history: IF, etc.7Kaz Kylheku
4 Apr 24 i i+* Re: Lisp history: IF, etc.5Alan Bawden
4 Apr 24 i ii+* Re: Lisp history: IF, etc.3Kaz Kylheku
4 Apr 24 i iii`* Re: Lisp history: IF, etc.2Kaz Kylheku
4 Apr 24 i iii `- on levels of disappointment (Was: Re: Lisp history: IF, etc.)1Julieta Shem
4 Apr 24 i ii`- Re: Lisp history: IF, etc.1Julieta Shem
5 Apr 24 i i`- Re: Lisp history: IF, etc.1Spiros Bousbouras
4 Apr 24 i +* Re: Lisp history: IF, etc.3Lawrence D'Oliveiro
4 Apr 24 i i`* Re: Lisp history: IF, etc.2Alan Bawden
4 Apr 24 i i `- Re: Lisp history: IF, etc.1Kaz Kylheku
12 Apr 24 i `* Re: Lisp history: IF, etc.2Alan Bawden
12 Apr 24 i  `- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro
4 Apr 24 `* Re: Lisp history: IF, etc.3Kaz Kylheku
4 Apr 24  `* Re: Lisp history: IF, etc.2Alan Bawden
4 Apr 24   `- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal