Sujet : Re: Lisp history: IF, etc.
De : alan (at) *nospam* csail.mit.edu (Alan Bawden)
Groupes : comp.lang.lispDate : 04. Apr 2024, 10:17:15
Autres entêtes
Organisation : ITS Preservation Society
Message-ID : <86r0flo838.fsf@williamsburg.bawden.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Kaz Kylheku <
643-408-1753@kylheku.com> writes:
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.
You can find his CACM letter online at:
https://doi.org/10.1145/368405.1773349Interestingly he did not propose using "if A then B else C" as the
syntax but rather "(A → B, T → C)", almost the same as in M-expressions!
(It would be cool if you were allowed to use the "(→,→)" form in what
Algol calls the "publication language", where you can write "x₉" instead
of "x[9]", but that is not the case.)
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!)
Not really the same as "invented the ternary IF, AS A SHORTHAND FOR A
ONE CLAUSE COND", but yeah it's certainly another way to get confused
about what actually happened.
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.txtNow that's a hoot. But that seems to just be a proposal. Does anyone
know if this was accepted?
- Alan
Date | Sujet | # | | Auteur |
2 Apr 24 | Lisp history: IF, etc. | 56 | | Alan Bawden |
2 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Kaz Kylheku |
3 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Gijs Hillenius |
3 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Gijs Hillenius |
3 Apr 24 | Re: Lisp history: IF, etc. | 49 | | Madhu |
3 Apr 24 | Re: Lisp history: IF, etc. | 48 | | Alan Bawden |
3 Apr 24 | Re: Lisp history: IF, etc. | 35 | | Paul Rubin |
3 Apr 24 | Re: Lisp history: IF, etc. | 34 | | Alan Bawden |
4 Apr 24 | Re: Lisp history: IF, etc. | 32 | | Paul Rubin |
4 Apr 24 | Re: Lisp history: IF, etc. | 5 | | Lawrence D'Oliveiro |
4 Apr 24 | Re: Lisp history: IF, etc. | 3 | | Axel Reichert |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Lawrence D'Oliveiro |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Paul Rubin |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Kaz Kylheku |
4 Apr 24 | Re: Lisp history: IF, etc. | 26 | | Alan Bawden |
5 Apr 24 | Re: Lisp history: IF, etc. | 25 | | Paul Rubin |
5 Apr 24 | Re: Lisp history: IF, etc. | 24 | | Julieta Shem |
5 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Julieta Shem |
6 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Lawrence D'Oliveiro |
15 Apr 24 | Re: Lisp history: IF, etc. | 21 | | Paul Rubin |
16 Apr 24 | Re: Lisp history: IF, etc. | 20 | | Jeff Barnett |
16 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Lawrence D'Oliveiro |
16 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Jeff Barnett |
16 Apr 24 | Re: Lisp history: IF, etc. | 16 | | Paul Rubin |
16 Apr 24 | Re: Lisp history: IF, etc. | 15 | | Jeff Barnett |
16 Apr 24 | Re: Lisp history: IF, etc. | 14 | | Lawrence D'Oliveiro |
16 Apr 24 | Re: Lisp history: IF, etc. | 12 | | Paul Rubin |
17 Apr 24 | Re: Lisp history: IF, etc. | 11 | | Lawrence D'Oliveiro |
17 Apr 24 | Re: Lisp history: IF, etc. | 10 | | Paul Rubin |
17 Apr 24 | Re: Lisp history: IF, etc. | 9 | | Jeff Barnett |
17 Apr 24 | Re: Lisp history: IF, etc. | 8 | | Lawrence D'Oliveiro |
17 Apr 24 | Re: Lisp history: IF, etc. | 7 | | Paul Rubin |
17 Apr 24 | Re: Lisp history: IF, etc. | 3 | | Madhu |
18 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Lawrence D'Oliveiro |
18 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Paul Rubin |
17 Apr 24 | Re: Lisp history: IF, etc. | 3 | | Ben Bacarisse |
18 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Lawrence D'Oliveiro |
18 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Stefan Monnier |
17 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Jeff Barnett |
17 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Stefan Ram |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Ben Bacarisse |
3 Apr 24 | Re: Lisp history: IF, etc. | 7 | | Kaz Kylheku |
4 Apr 24 | Re: Lisp history: IF, etc. | 5 | | Alan Bawden |
4 Apr 24 | Re: Lisp history: IF, etc. | 3 | | Kaz Kylheku |
4 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Kaz Kylheku |
4 Apr 24 | on levels of disappointment (Was: Re: Lisp history: IF, etc.) | 1 | | Julieta Shem |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Julieta Shem |
5 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Spiros Bousbouras |
4 Apr 24 | Re: Lisp history: IF, etc. | 3 | | Lawrence D'Oliveiro |
4 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Alan Bawden |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Kaz Kylheku |
12 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Alan Bawden |
12 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Lawrence D'Oliveiro |
4 Apr 24 | Re: Lisp history: IF, etc. | 3 | | Kaz Kylheku |
4 Apr 24 | Re: Lisp history: IF, etc. | 2 | | Alan Bawden |
4 Apr 24 | Re: Lisp history: IF, etc. | 1 | | Lawrence D'Oliveiro |