Re: Lisp history: IF, etc.

Liste des GroupesRevenir à cl lisp 
Sujet : Re: Lisp history: IF, etc.
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.lisp
Date : 04. Apr 2024, 06:28:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240403211041.911@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-04-02, Alan Bawden <alan@csail.mit.edu> wrote:
Kaz Kylheku <643-408-1753@kylheku.com> writes:
>
   ...  The code is from just before MacCarthy invented the ternary IF,
   as a shorthand for a one clause cond: ...
>
I don't think that McCarthy invented IF as an abbreviation for COND, but
I could be wrong.

OK, I found the smoking gun.  Why, it's under our noses: Maccarthy's
February 1979 "History of Lisp" paper.

http://jmc.stanford.edu/articles/lisp/lisp.pdf

(Don't try HTTPS, it doesn't resolve to the PDF. There may be other
hostings of it.)

Quote:

    I invented conditional expressions in connection with a set of chess
  legal move routines I wrote in FORTRAN for the IBM 704 at M.I.T.
  during 1957-58. This program did not use list processing. The IF
  statement provided in FORTRAN 1 and FORTRAN 2 was very awkward to use,
  and it was natural to invent a function XIF(M,N1,N2) whose value was
  N1 or N2 according to whether the expression M was zero or not. The
  function shortened many programs and made them easier to understand,
  but it had to be used sparingly, because all three arguments had to be
  evaluated before XIF was entered, since XIF was called as an ordinary
  FORTRAN function though written in machine language. This led to the
  invention of the true conditional expression which evaluates only one
  of N1 and N2 according to whether M is true or false and to a desire
  for a programming language that would allow its use.

    A paper defining conditional expressions and proposing their use in
  Algol was sent to the Communications of the ACM but was arbitrarily
  demoted to a letter to the editor, because it was very short.

There you go; no hallucination or urban legends. Now, this does not
establish that MacCarthy ever worked with (if A B C) in Lisp.  But
that is just a variation on the same idea; a footnote, if you will.

MacCarthy used XIF(A, B, C), in his own words, to shorten many programs,
and make them easier to understand, in his own words. (In Lisp, we
can use IF to shorten programs that use COND!)

The part about the "desire for a programming language that would allow
its use" is also important; his inclusion of a conditional in Lisp can
be traced to these thoughts, which have their origin in working with
a three-argument form, and desire to have it with the right evaluation
semantics.

As for Fortran, it eventually caved in and got a conditional operator.
In the year 2021!!! https://j3-fortran.org/doc/year/21/21-157r2.txt

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

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