Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"The lesser of two evils -- is evil." -- Seymour (Sy) Leon


devel / comp.lang.lisp / Lisp history: IF, etc.

SubjectAuthor
* Lisp history: IF, etc.Alan Bawden
+- Re: Lisp history: IF, etc.Kaz Kylheku
+- Re: Lisp history: IF, etc.Gijs Hillenius
+- Re: Lisp history: IF, etc.Gijs Hillenius
+* Re: Lisp history: IF, etc.Madhu
|`* Re: Lisp history: IF, etc.Alan Bawden
| +* Re: Lisp history: IF, etc.Paul Rubin
| |`* Re: Lisp history: IF, etc.Alan Bawden
| | +* Re: Lisp history: IF, etc.Paul Rubin
| | |+* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | ||+* Re: Lisp history: IF, etc.Axel Reichert
| | |||+- Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |||`- Re: Lisp history: IF, etc.Paul Rubin
| | ||`- Re: Lisp history: IF, etc.Kaz Kylheku
| | |`* Re: Lisp history: IF, etc.Alan Bawden
| | | `* Re: Lisp history: IF, etc.Paul Rubin
| | |  `* Re: Lisp history: IF, etc.Julieta Shem
| | |   +- Re: Lisp history: IF, etc.Julieta Shem
| | |   +- Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |   `* Re: Lisp history: IF, etc.Paul Rubin
| | |    `* Re: Lisp history: IF, etc.Jeff Barnett
| | |     +* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |     |`- Re: Lisp history: IF, etc.Jeff Barnett
| | |     +* Re: Lisp history: IF, etc.Paul Rubin
| | |     |`* Re: Lisp history: IF, etc.Jeff Barnett
| | |     | `* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |     |  +* Re: Lisp history: IF, etc.Paul Rubin
| | |     |  |`* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |     |  | `* Re: Lisp history: IF, etc.Paul Rubin
| | |     |  |  `* Re: Lisp history: IF, etc.Jeff Barnett
| | |     |  |   `* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |     |  |    `* Re: Lisp history: IF, etc.Paul Rubin
| | |     |  |     +* Re: Lisp history: IF, etc.Madhu
| | |     |  |     |`* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |     |  |     | `- Re: Lisp history: IF, etc.Paul Rubin
| | |     |  |     `* Re: Lisp history: IF, etc.Ben Bacarisse
| | |     |  |      `* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| | |     |  |       `- Re: Lisp history: IF, etc.Stefan Monnier
| | |     |  `- Re: Lisp history: IF, etc.Jeff Barnett
| | |     `- Re: Lisp history: IF, etc.Stefan Ram
| | `- Re: Lisp history: IF, etc.Ben Bacarisse
| +* Re: Lisp history: IF, etc.Kaz Kylheku
| |+* Re: Lisp history: IF, etc.Alan Bawden
| ||+* Re: Lisp history: IF, etc.Kaz Kylheku
| |||`* Re: Lisp history: IF, etc.Kaz Kylheku
| ||| `- on levels of disappointment (Was: Re: Lisp history: IF, etc.)Julieta Shem
| ||`- Re: Lisp history: IF, etc.Julieta Shem
| |`- Re: Lisp history: IF, etc.Spiros Bousbouras
| +* Re: Lisp history: IF, etc.Lawrence D'Oliveiro
| |`* Re: Lisp history: IF, etc.Alan Bawden
| | `- Re: Lisp history: IF, etc.Kaz Kylheku
| `* Re: Lisp history: IF, etc.albert
|  `* Re: Lisp history: IF, etc.Alan Bawden
|   `- Re: Lisp history: IF, etc.Lawrence D'Oliveiro
`* Re: Lisp history: IF, etc.Kaz Kylheku
 `* Re: Lisp history: IF, etc.Alan Bawden
  `- Re: Lisp history: IF, etc.Lawrence D'Oliveiro

Pages:123
Lisp history: IF, etc.

<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10774&group=comp.lang.lisp#10774

  copy link   Newsgroups: comp.lang.misc comp.lang.lisp
Followup: comp.lang.lisp
Path: i2pn2.org!rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.misc,comp.lang.lisp
Subject: Lisp history: IF, etc.
Followup-To: comp.lang.lisp
Date: Tue, 02 Apr 2024 14:38:25 -0400
Organization: ITS Preservation Society
Lines: 44
Message-ID: <86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 02 Apr 2024 18:39:17 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="df04b508c9e026fad8da017ca6ea5645";
logging-data="3548728"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sMJQlrfH30MTXdGFPb/FH"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:tn+ngqMlDdeBtBnuN3LsSmr4LsY=
sha1:q5M3IMvi1yFSedYJf/X63HDKByk=
 by: Alan Bawden - Tue, 2 Apr 2024 18:38 UTC

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. 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'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]"!

- Alan

Re: Lisp history: IF, etc.

<20240402124249.195@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10775&group=comp.lang.lisp#10775

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Tue, 2 Apr 2024 19:44:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <20240402124249.195@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
Injection-Date: Tue, 02 Apr 2024 19:44:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d32078294708f72fe3a949b9ce8e6715";
logging-data="3578386"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19N4la8i185npL+v4HH9b/ZqLtDX7G1Ofk="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:AfsQRDs83JQ67L4tuYUV1JPaLvw=
 by: Kaz Kylheku - Tue, 2 Apr 2024 19:44 UTC

On 2024-04-02, Alan Bawden <alan@csail.mit.edu> wrote:
> But I'd love to see evidence that McCarthy arrived at ternary IF before
> anyone else.

I seem to be aware of at least some urban legend along these lines.
From your detailed historic "been there" understanding, that's what it
must be.

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

Re: Lisp history: IF, etc.

<87v84zrm2l.fsf@hillenius.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10776&group=comp.lang.lisp#10776

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: gij...@hillenius.net (Gijs Hillenius)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 08:34:42 +0200
Organization: Using Emacs' Org Mode
Lines: 26
Message-ID: <87v84zrm2l.fsf@hillenius.net>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net d6HYSGPb0BzWhRlMADtjEQcRvdgZb/UfUeYNUzvqNssSC26LDN
Cancel-Lock: sha1:okKlBPPi1QnFepRseGw/9iC44yY= sha1:8q+Bs8Uxvr8zttcHIRr7sRZacs0= sha256:k4gPYL/XXfmjiWHQ5G5Ejb4hVbq2AnV0hSGBmuOrAfU=
OpenPGP: id=340F F9A4 8F6C 18FD D032 0C33 ABA1 CB30 E997 A3AF
X-Operating-System: Debian GNU/Linux Sid
User-Agent: Gnus/5.13 (Gnus v5.13)
 by: Gijs Hillenius - Wed, 3 Apr 2024 06:34 UTC

On 2 April 2024 14:38 Alan Bawden, 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. 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.)

"If" is available in Medley, (https://interlisp.org/):

,----
| (IF X COMS₁)
|
| If [EVAL X]is true, execute COMS₁; otherwise generate an error.
`----

Re: Lisp history: IF, etc.

<87o7arrlzy.fsf@hillenius.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10777&group=comp.lang.lisp#10777

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: gij...@hillenius.net (Gijs Hillenius)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 08:36:17 +0200
Organization: Using Emacs' Org Mode
Lines: 25
Message-ID: <87o7arrlzy.fsf@hillenius.net>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 0i4oEYoFuyRTa+u8xmPFiwrRLCQ2armGKONmPJ11veHnhl4duc
Cancel-Lock: sha1:949gZ6Gr4e6P63t0KJIU0aS9rzo= sha1:totcw90AaQ2fl4At5GScKoaWoMM= sha256:Y2TpNy9q2LRoioGvVbuj/yKH380Z56nzbl6zySPTGCM=
OpenPGP: id=340F F9A4 8F6C 18FD D032 0C33 ABA1 CB30 E997 A3AF
X-Operating-System: Debian GNU/Linux Sid
User-Agent: Gnus/5.13 (Gnus v5.13)
 by: Gijs Hillenius - Wed, 3 Apr 2024 06:36 UTC

On 2 April 2024 14:38 Alan Bawden, 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. 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.)

"If" is available in Medley, (https://interlisp.org/):

,----
| (IF X COMS₁)
|
| If [EVAL X]is true, execute COMS₁; otherwise generate an error.
`----

Re: Lisp history: IF, etc.

<m3frw2vlok.fsf@leonis4.robolove.meer.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10778&group=comp.lang.lisp#10778

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: enom...@meer.net (Madhu)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 14:59:31 +0530
Organization: Motzarella
Lines: 56
Message-ID: <m3frw2vlok.fsf@leonis4.robolove.meer.net>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 09:29:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b54a13a3c39393c19b2a045594038c4b";
logging-data="4036731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kY7ZOMEsOt0W8Tj65uKeoI5zkORnGVn4="
Cancel-Lock: sha1:SD0N+qol+cJWdkX18kC/PF/EpYw=
sha1:XjzcVMugUesNVIJWb9ogMgpTi/g=
 by: Madhu - Wed, 3 Apr 2024 09:29 UTC

* 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

Re: Lisp history: IF, etc.

<86cyr6pb2l.fsf@williamsburg.bawden.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10779&group=comp.lang.lisp#10779

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 14:15:14 -0400
Organization: ITS Preservation Society
Lines: 68
Message-ID: <86cyr6pb2l.fsf@williamsburg.bawden.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 18:15:17 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="405a719eff2d4e98771eb6c14c7c6282";
logging-data="97595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+scI3zIl8YC1rov99KBSMg"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:2+RvKGCjG6GVejYuq/IVng7VcqQ=
sha1:DijL3Vd8inJrasCJe7Ly5T4Xkb8=
 by: Alan Bawden - Wed, 3 Apr 2024 18:15 UTC

Madhu <enometh@meer.net> writes:

* Alan Bawden <86h6gjpq3i.fsf_-_@williamsburg.bawden.org> :
Wrote on Tue, 02 Apr 2024 14:38:25 -0400:
> ...
> 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.

Lisp doesn't really have statements _because_ McCarthy invented the
conditional expression. That's kind of the point. Other programming
languages at the time (e.g. FORTRAN and ALGOL) only had conditional
statements. McCarthy invented the conditional expression and thus
created the first expression-only programming language.

> 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

The original claim I was responding to was that McCarthy had invented IF
"as a shorthand for a one clause COND". That certainly wouldn't have
been worth publishing as a result in itself. But it would certainly be
possible for him to have introduced an IF shorthand _in passing_ in the
course of doing something else -- like in some Lisp code he wrote to do
something of real interest. But there seems to be no evidence for that.

To summarize:

(1) McCarthy invented the conditional expression, written in his
M-expression language as:
[expr -> expr; expr -> expr; T -> expr]

(2) McCarthy also invented the S-expression representation for that as:
(COND (expr expr) (expr expr) (T expr))

(3) But there is no evidence that McCarthy ever, for _any_ reason, ever
wrote:
(IF expr expr expr)

People sometimes sloppily say that "McCarthy invented the
if-expression", by which they really mean just (1). It is also true
that McCarthy invented (2) the COND S-expression, but there is nothing
particularly interesting about that, it was just part of the encoding he
invented for representing M-expressions as S-expressions. (For which he
also invented the LAMBDA, QUOTE and LABEL S-expressions.) But there
seems to be no evidence that McCarthy ever invented (3) an "IF
S-expression" for any reason whatsoever.

- Alan

Re: Lisp history: IF, etc.

<875xwy412p.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10780&group=comp.lang.lisp#10780

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 13:56:46 -0700
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <875xwy412p.fsf@nightsong.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 20:56:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ba7c9c74527dca8c56b474677d5f18cd";
logging-data="170692"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NwnT4qe6EbJAeTBwRdA18"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:aRlt0CU+Lt3ltkq9DTlzKm7EJQk=
sha1:6qcrRQvylT3ZC8jVbkaRUPio/Yg=
 by: Paul Rubin - Wed, 3 Apr 2024 20:56 UTC

Alan Bawden <alan@csail.mit.edu> writes:
> McCarthy invented the conditional expression and thus created the
> first expression-only programming language.

I think Church's lambda calculus also had this.

https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans

Re: Lisp history: IF, etc.

<20240403134752.491@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10781&group=comp.lang.lisp#10781

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 3 Apr 2024 20:57:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <20240403134752.491@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
Injection-Date: Wed, 03 Apr 2024 20:57:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3731bd2a32f4bb5c9f2d85a787cad4a9";
logging-data="170890"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nl2+FahGfbfcMDcqwlj6tuCxjX9bl/nQ="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:62eMW8cm8bTiRUOh6hbHRxob6QQ=
 by: Kaz Kylheku - Wed, 3 Apr 2024 20:57 UTC

On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
> Lisp doesn't really have statements _because_ McCarthy invented the
> conditional expression. That's kind of the point. Other programming
> languages at the time (e.g. FORTRAN and ALGOL) only had conditional
> statements. McCarthy invented the conditional expression and thus
> created the first expression-only programming language.

However, conditional expressions ultimately come from math. E.g for
specifying a discontinuous function:

f(x) = { x, if x >= 0
{ 0, if x < 0
If you think about it, it's actually kind of ignorant to invent a
programming language with imperative if statements, but in which where
the math conditional is missing.

> People sometimes sloppily say that "McCarthy invented the
> if-expression", by which they really mean just (1). It is also true

That could be the origin of the misconception; someone is going to
take that sort of statement literally.

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

Re: Lisp history: IF, etc.

<868r1up0wk.fsf@williamsburg.bawden.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10783&group=comp.lang.lisp#10783

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 17:54:51 -0400
Organization: ITS Preservation Society
Lines: 32
Message-ID: <868r1up0wk.fsf@williamsburg.bawden.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<875xwy412p.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 21:54:55 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="405a719eff2d4e98771eb6c14c7c6282";
logging-data="195927"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Z9ctlpgO8bKu3zvWwhFY9"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:oYfTDtBM8K1RgEx0CU9hMdquHUo=
sha1:rTDVOj6isqpAnoj7f+TI6oC6m2A=
 by: Alan Bawden - Wed, 3 Apr 2024 21:54 UTC

Paul Rubin <no.email@nospam.invalid> writes:

Alan Bawden <alan@csail.mit.edu> writes:
> McCarthy invented the conditional expression and thus created the
> first expression-only programming language.

I think Church's lambda calculus also had this.

https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans

Yeah, I though about that while I was composing my previous message, but
my life is finite, so I didn't go there. But this is Usenet, so we are
forced to explore every side issue until we all drop dead of exhaustion.

So does Lambda Calculus qualify as a programming language? Well _today_
we would all say yes, because we have examples of purely functional
programming languages where evaluation is lazy and so we don't need a
special operator for conditional evaluation. But when McCarthy was
inventing Lisp, nobody thought that pure Lambda Calculus was anything
like a programming language. It's only since then that we've done the
work to make that practical.

So I _could_ argue that in 1958 Lambda Calculus was _not_ a programming
language, but today in 2024 Lambda Calculus _is_ a programming language,
even though Lambda Calculus didn't change in any way!

But given the way being a "programming language" was understood in 1958,
nobody was going to invent an expression-only programming language until
they first invented the conditional expression. So thank you John
McCarthy.

- Alan

Re: Lisp history: IF, etc.

<871q7m3wrj.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10784&group=comp.lang.lisp#10784

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 15:29:52 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <871q7m3wrj.fsf@nightsong.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 22:29:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fb66b83d920913d8a6d24a22d297cd2f";
logging-data="207155"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18x7186KiQn9aKLgqa+za2k"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:a5kwjzLRdZRnP5y27KlZErfpjXI=
sha1:i4QLP6wZnYooVhCLlYhEjCb3yxE=
 by: Paul Rubin - Wed, 3 Apr 2024 22:29 UTC

Alan Bawden <alan@csail.mit.edu> writes:
> But when McCarthy was inventing Lisp, nobody thought that pure Lambda
> Calculus was anything like a programming language.

Ah ok, that was before my time. I had been under the impression that
Lisp had started as lambda calculus with some concessions to
practicality added.

https://en.wikipedia.org/wiki/Lisp_(programming_language)#History

gives that impression too.

> It's only since then that we've done the work to make that practical.

Does Scheme not count? I think lazy evaluation is not needed since the
input to the Church boolean (I hope I have the jargon right) is two
lambda abstractions. The boolean selects one of them, and the result is
applied to whatever the next thing is.

Re: Lisp history: IF, etc.

<864jcioz0a.fsf@williamsburg.bawden.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10785&group=comp.lang.lisp#10785

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 18:35:49 -0400
Organization: ITS Preservation Society
Lines: 38
Message-ID: <864jcioz0a.fsf@williamsburg.bawden.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<20240403134752.491@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 22:35:52 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="e07f213705933abd0291280324cd0958";
logging-data="214547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LlFmOlqVEBOcLo4SsWp5C"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:dhfJsS0FdgfBcP96uMBUp7qajho=
sha1:JVPSVXugGN0cJ9cyHcI1f4l7HiE=
 by: Alan Bawden - Wed, 3 Apr 2024 22:35 UTC

Kaz Kylheku <643-408-1753@kylheku.com> writes:

On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
> Lisp doesn't really have statements _because_ McCarthy invented the
> conditional expression. That's kind of the point. Other programming
> languages at the time (e.g. FORTRAN and ALGOL) only had conditional
> statements. McCarthy invented the conditional expression and thus
> created the first expression-only programming language.

However, conditional expressions ultimately come from math. E.g for
specifying a discontinuous function:

f(x) = { x, if x >= 0
{ 0, if x < 0

If you think about it, it's actually kind of ignorant to invent a
programming language with imperative if statements, but in which where
the math conditional is missing.

If you think like a historian, you don't describe this as "ignorant".
It's just not something that was above the horizon in the mind set of
the time. After all, that mathematical notation you are referring to
isn't something that mathematicians get very formal about. It has a
status that's midway between being able to define something using a
simple equation, and having to resort to a definition in the form of a
paragraph of words. Realizing that you could tighten that notation up
and use it in a programming language _as a kind of expression_ is
actually a bit of a leap.

> People sometimes sloppily say that "McCarthy invented the
> if-expression", by which they really mean just (1). It is also true

That could be the origin of the misconception; someone is going to
take that sort of statement literally.

Yes, that was exactly my point.

- Alan

Re: Lisp history: IF, etc.

<20240403160807.556@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10787&group=comp.lang.lisp#10787

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 3 Apr 2024 23:12:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <20240403160807.556@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org> <20240403134752.491@kylheku.com>
<864jcioz0a.fsf@williamsburg.bawden.org>
Injection-Date: Wed, 03 Apr 2024 23:12:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c584e056168df3e72ae6023a5eb1af29";
logging-data="223136"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/b4twZoWdI/jQUX3lMoIHzdokhWFKZQOs="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:sWCWihj3e5JK1E1POnHC7wmfrnQ=
 by: Kaz Kylheku - Wed, 3 Apr 2024 23:12 UTC

On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>
> On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
> > Lisp doesn't really have statements _because_ McCarthy invented the
> > conditional expression. That's kind of the point. Other programming
> > languages at the time (e.g. FORTRAN and ALGOL) only had conditional
> > statements. McCarthy invented the conditional expression and thus
> > created the first expression-only programming language.
>
> However, conditional expressions ultimately come from math. E.g for
> specifying a discontinuous function:
>
> f(x) = { x, if x >= 0
> { 0, if x < 0
>
> If you think about it, it's actually kind of ignorant to invent a
> programming language with imperative if statements, but in which where
> the math conditional is missing.
>
> If you think like a historian, you don't describe this as "ignorant".
> It's just not something that was above the horizon in the mind set of
> the time. After all, that mathematical notation you are referring to
> isn't something that mathematicians get very formal about.

That is a fair observation; roughly speaking, higher languages first
evolved from that of the machine. Why we have an if /statement/ is that
the machine has testing and branching in its instruction set, which are
also statements. The imperative language that works by jumping around
and shuffling mainly word-sized quantities inside a Von Neumann machine
is an abstraction of machine language, not an abstraction of functions.

The abstraction of machine language isn't ignorant, it's just different.

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

Re: Lisp history: IF, etc.

<20240403161243.959@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10788&group=comp.lang.lisp#10788

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 3 Apr 2024 23:16:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <20240403161243.959@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org> <20240403134752.491@kylheku.com>
<864jcioz0a.fsf@williamsburg.bawden.org> <20240403160807.556@kylheku.com>
Injection-Date: Wed, 03 Apr 2024 23:16:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c584e056168df3e72ae6023a5eb1af29";
logging-data="223136"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Thh5TeWbdl+TF+hsmR7IfmHYhfIa5dr8="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:p8YL5uJT7pJCumyOetW0B60Cbpk=
 by: Kaz Kylheku - Wed, 3 Apr 2024 23:16 UTC

On 2024-04-03, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
> On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
>> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>> If you think about it, it's actually kind of ignorant to invent a
>> programming language with imperative if statements, but in which where
>> the math conditional is missing.
>>
>> If you think like a historian, you don't describe this as "ignorant".
>> It's just not something that was above the horizon in the mind set of
>> the time. After all, that mathematical notation you are referring to
>> isn't something that mathematicians get very formal about.
>
> That is a fair observation; roughly speaking, higher languages first
> evolved from that of the machine. Why we have an if /statement/ is that
> the machine has testing and branching in its instruction set, which are
> also statements. The imperative language that works by jumping around
> and shuffling mainly word-sized quantities inside a Von Neumann machine
> is an abstraction of machine language, not an abstraction of functions.
>
> The abstraction of machine language isn't ignorant, it's just different.

But, right, okay; I lost a thoguht I had some hours earlier about this.
By the time we have a higher level language inspired by math formulas in
which you can do A * B + C, and define math-like functions, you would
think that the right synapse would fire between the right two brain
cells, so that a value-yielding conditional would be supplied. When you
have translation of arithmetic formulas to machine language, the scene
is ripe for such an operator. So maybe ignorance is a strong word, but
there is a margin for disappointment.

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

Re: Lisp history: IF, etc.

<87v84yrpzt.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10789&group=comp.lang.lisp#10789

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 04 Apr 2024 00:22:14 +0100
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <87v84yrpzt.fsf@bsb.me.uk>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 23:22:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a195b927e660ad93b5411fcef89cbd22";
logging-data="233871"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+S+FG459PL30kLc9bS+atRPnWPVAIp6Hc="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:/YlMp7I/axQ1zpwGYLwLAUUET6s=
sha1:58yzGDExdwJDxKDKVZwCrWDJCn0=
X-BSB-Auth: 1.2f74c27a51d22a4113a8.20240404002214BST.87v84yrpzt.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 3 Apr 2024 23:22 UTC

Alan Bawden <alan@csail.mit.edu> writes:

> Paul Rubin <no.email@nospam.invalid> writes:
>
> Alan Bawden <alan@csail.mit.edu> writes:
> > McCarthy invented the conditional expression and thus created the
> > first expression-only programming language.
>
> I think Church's lambda calculus also had this.
>
> https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans
>
> Yeah, I though about that while I was composing my previous message, but
> my life is finite, so I didn't go there. But this is Usenet, so we are
> forced to explore every side issue until we all drop dead of exhaustion.
>
> So does Lambda Calculus qualify as a programming language? Well _today_
> we would all say yes, because we have examples of purely functional
> programming languages where evaluation is lazy and so we don't need a
> special operator for conditional evaluation. But when McCarthy was
> inventing Lisp, nobody thought that pure Lambda Calculus was anything
> like a programming language. It's only since then that we've done the
> work to make that practical.

Pinning down exactly constitutes a programming language is not going to
be very fruitful! But Church invented the lambda calculus to define
what "effectively computable" or "effective procedure" means. (He was
interested in the Entscheidungsproblem). Its purpose was to capture the
notion of symbolic actions that could be performed "mechanically" but
without a physical mechanism. That was the whole point. Is that a
programming language? I'll pass on that, but it's clearly a notation
for writing abstract computations.

> So I _could_ argue that in 1958 Lambda Calculus was _not_ a programming
> language, but today in 2024 Lambda Calculus _is_ a programming language,
> even though Lambda Calculus didn't change in any way!

It's more helpful, I think, to consider what McCarthy would have around
as influences. Did he know of the work by Church (and Kleene and
Rosser)? Surely he did. But Church's Booleans put a very different
spin on conditional expressions, so I say it's fair to say that what we
see in early Lisp is McCarthy's own.

--
Ben.

Re: Lisp history: IF, etc.

<87jzleuird.fsf@tudado.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10790&group=comp.lang.lisp#10790

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jsh...@yaxenu.org (Julieta Shem)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 20:30:14 -0300
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <87jzleuird.fsf@tudado.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<20240403134752.491@kylheku.com>
<864jcioz0a.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 03 Apr 2024 23:30:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bb48a4d207a32d025d5421b40825cb35";
logging-data="236346"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190bT77Bjs+YknHS0NR6NG8QmP4AX9pqio="
Cancel-Lock: sha1:Vehoa6p+nFkajJSjGPEC6qSb11c=
sha1:vwHVuAh7yiAzySL2fTvx7wFi+8k=
 by: Julieta Shem - Wed, 3 Apr 2024 23:30 UTC

Alan Bawden <alan@csail.mit.edu> writes:

> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>
> On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
> > Lisp doesn't really have statements _because_ McCarthy invented the
> > conditional expression. That's kind of the point. Other programming
> > languages at the time (e.g. FORTRAN and ALGOL) only had conditional
> > statements. McCarthy invented the conditional expression and thus
> > created the first expression-only programming language.
>
> However, conditional expressions ultimately come from math. E.g for
> specifying a discontinuous function:
>
> f(x) = { x, if x >= 0
> { 0, if x < 0
>
> If you think about it, it's actually kind of ignorant to invent a
> programming language with imperative if statements, but in which where
> the math conditional is missing.
>
> If you think like a historian, you don't describe this as "ignorant".
> It's just not something that was above the horizon in the mind set of
> the time. After all, that mathematical notation you are referring to
> isn't something that mathematicians get very formal about.

So true.

> It has a status that's midway between being able to define something
> using a simple equation, and having to resort to a definition in the
> form of a paragraph of words. Realizing that you could tighten that
> notation up and use it in a programming language _as a kind of
> expression_ is actually a bit of a leap.

There's a paper from 1961--1963 in which he defines the conditional
expression with the intention of being able to define functions
recursively.

--8<---------------cut here---------------start------------->8---
A BASIS FOR A MATHEMATICAL THEORY OF COMPUTATION
JOHN McCARTHY
1961--1963

[This 1963 paper was included in Computer Programming and Formal Sys-
tems, edited by P. Braffort and D. Hirshberg and published by
North-Holland. An earlier version was published in 1961 in the
Proceedings of the Western Joint Computer Conference.]

[...]

The present paper is an attempt to create a basis for a mathematical
theory of computation. [...]

[...]

2.1 Functions Computable in Terms of Given Base Functions

Suppose we are given a base collection F of functions (including
predicates) having certain domains and ranges. [...] Our object is to
define a class of functions C{F} which we shall call the class of
functions computable in terms of F. Before developing C{F} formally,
we wish to give an example, and in order to give the example, we first
need the concept of conditional expression. In our notation a
conditional expression has the form

(p1 → e1, p2 → e2, . . . , pn → en)

which corresponds to the ALGOL 60 reference language (12) expression

if p1 then e1 else if p2 then e2 . . . else if pn then en.

[...]

Some examples of the conditional expressions for well known functions
are |x| = (x < 0 → -x, x >= 0 → x) [...]

Now we are ready to use conditional expressions to define functions
recursively. For example, we have

n! = (n = 0 → 1, n =/= 0 → n · (n − 1)!)

[...]
--8<---------------cut here---------------end--------------->8---

on levels of disappointment (Was: Re: Lisp history: IF, etc.)

<878r1uuiej.fsf_-_@tudado.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10791&group=comp.lang.lisp#10791

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jsh...@yaxenu.org (Julieta Shem)
Newsgroups: comp.lang.lisp
Subject: on levels of disappointment (Was: Re: Lisp history: IF, etc.)
Date: Wed, 03 Apr 2024 20:37:56 -0300
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <878r1uuiej.fsf_-_@tudado.org>
References: <uu54la$3su5b$6@dont-email.me> <20240329084454.0000090f@gmail.com>
<uu6om5$cmv8$1@dont-email.me> <20240329101248.556@kylheku.com>
<uu6t9h$dq4d$1@dont-email.me> <20240329104716.777@kylheku.com>
<uu8p02$uebm$1@dont-email.me> <20240330112105.553@kylheku.com>
<uudrfg$2cskm$1@dont-email.me> <87r0fp8lab.fsf@tudado.org>
<uuehdj$2hshe$1@dont-email.me> <87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<20240403134752.491@kylheku.com>
<864jcioz0a.fsf@williamsburg.bawden.org>
<20240403160807.556@kylheku.com> <20240403161243.959@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Apr 2024 23:37:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bb48a4d207a32d025d5421b40825cb35";
logging-data="236346"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lfZmfpD6Q1EoD5IBmYTqB1SzhqLxQ8bo="
Cancel-Lock: sha1:t7TJinOCR1+NqsHzAxaruN1Egt0=
sha1:9BvisZZ1Y7klu6zkfg1/XpYsvRE=
 by: Julieta Shem - Wed, 3 Apr 2024 23:37 UTC

Kaz Kylheku <643-408-1753@kylheku.com> writes:

> On 2024-04-03, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>> On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
>>> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>>> If you think about it, it's actually kind of ignorant to invent a
>>> programming language with imperative if statements, but in which where
>>> the math conditional is missing.
>>>
>>> If you think like a historian, you don't describe this as "ignorant".
>>> It's just not something that was above the horizon in the mind set of
>>> the time. After all, that mathematical notation you are referring to
>>> isn't something that mathematicians get very formal about.
>>
>> That is a fair observation; roughly speaking, higher languages first
>> evolved from that of the machine. Why we have an if /statement/ is that
>> the machine has testing and branching in its instruction set, which are
>> also statements. The imperative language that works by jumping around
>> and shuffling mainly word-sized quantities inside a Von Neumann machine
>> is an abstraction of machine language, not an abstraction of functions.
>>
>> The abstraction of machine language isn't ignorant, it's just different.
>
> But, right, okay; I lost a thoguht I had some hours earlier about this.
> By the time we have a higher level language inspired by math formulas in
> which you can do A * B + C, and define math-like functions, you would
> think that the right synapse would fire between the right two brain
> cells, so that a value-yielding conditional would be supplied. When you
> have translation of arithmetic formulas to machine language, the scene
> is ripe for such an operator. So maybe ignorance is a strong word, but
> there is a margin for disappointment.

But it's not the same disappointment as in having to use JIRA, right? :-)

``Writing bug reports on napkins and keeping them crumpled in a large
black garbage bag is better than this fucking piece of crap called
JIRA.'' -- Kaz Kylheku, 2016.

(*) Full source

--8<---------------cut here---------------start------------->8---
X-Received: by 10.200.47.116 with SMTP id k49mr3706471qta.61.1474251695757;
Sun, 18 Sep 2016 19:21:35 -0700 (PDT)
X-BeenThere: comp.programming@googlegroups.com
Received: by 10.157.2.1 with SMTP id 1ls4320407otb.4.gmail; Sun, 18 Sep 2016
19:21:33 -0700 (PDT)
X-Received: by 10.157.2.104 with SMTP id 95mr3727234otb.133.1474251693667;
Sun, 18 Sep 2016 19:21:33 -0700 (PDT)
MIME-Version: 1.0
Path: b4ni5152iti.0!nntp.google.com!news.glorb.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!enother.net!enother.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From: Kaz Kylheku <221-50...@kylheku.com>
Newsgroups: alt.comp.os.linux,comp.programming,comp.software-eng
Subject: Re: Favourite Software Development Tools for Teams?
Followup-To: comp.programming
Date: Mon, 19 Sep 2016 02:21:29 +0000 (UTC)
Organization: Aioe.org NNTP Server
Lines: 11
Message-ID: <20160918192003.449@kylheku.com>
References: <E9HDz.15308$LX2.8752@fx36.iad>
NNTP-Posting-Host: OGJi3KNpFOhM58UHZwXj0w.user.gioia.aioe.org
X-Complaints-To: ab...@aioe.org
User-Agent: slrn/pre1.0.0-18 (Linux)
X-Notice: Filtered by postfilter v. 0.8.2

["Followup-To:" header set to comp.programming.]
On 2016-09-19, Triscal Islington <trust.your...@mail.ru> wrote:
> I'm finally heading my own software engineering project at work and,
> since I call the shots, it's up to me to decide on what collaboration
> and review tools we utilize on the project.
>
> I'm pretty well decided on git for source code management but what are
> your favourite linux tool for bug tracking, code review, collaboration, etc?

Writing bug reports on napkins and keeping them crumpled in a large
black garbage bag is better than this fucking piece of crap called JIRA.
--8<---------------cut here---------------end--------------->8---

Re: Lisp history: IF, etc.

<uukr0q$7l0i$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10792&group=comp.lang.lisp#10792

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 4 Apr 2024 00:07:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uukr0q$7l0i$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com> <86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 00:07:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b2ebab76618f2906d24b8f2b6b05668a";
logging-data="250898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+F7luGTXQ00tmBcp/E2q3f"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ZNR2KnX1HBD6K7lkuihstFOx7bY=
 by: Lawrence D'Oliv - Thu, 4 Apr 2024 00:07 UTC

On Wed, 03 Apr 2024 14:15:14 -0400, Alan Bawden wrote:

> Other programming languages at the time (e.g. FORTRAN and ALGOL) only
> had conditional statements.

Algol60 had if-expressions, e.g.

a := if b then c else d

Fortran had loop expressions, but they were only allowed in I/O
statements.

Re: Lisp history: IF, etc.

<uukr74$7l0f$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10793&group=comp.lang.lisp#10793

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 4 Apr 2024 00:11:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uukr74$7l0f$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com> <86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org> <875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org> <871q7m3wrj.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 00:11:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b2ebab76618f2906d24b8f2b6b05668a";
logging-data="250895"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Vf3CewSEe5/IOn4IngE4b"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:tA7K5tkASSLSv100WpfQvaomR5Y=
 by: Lawrence D'Oliv - Thu, 4 Apr 2024 00:11 UTC

On Wed, 03 Apr 2024 15:29:52 -0700, Paul Rubin wrote:

> I think lazy evaluation is not needed since the
> input to the Church boolean (I hope I have the jargon right) is two
> lambda abstractions. The boolean selects one of them, and the result is
> applied to whatever the next thing is.

I use this in Python, to try to avoid that abortion that is the Python
conditional expression. Instead of, say,

a = x / y if y != 0 else 0

I would do

a = (lambda : 0, lambda : x / y)[y != 0]()

Re: Lisp history: IF, etc.

<86zfu9ooux.fsf@williamsburg.bawden.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10794&group=comp.lang.lisp#10794

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 22:15:02 -0400
Organization: ITS Preservation Society
Lines: 64
Message-ID: <86zfu9ooux.fsf@williamsburg.bawden.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org>
<871q7m3wrj.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Apr 2024 02:15:06 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="e07f213705933abd0291280324cd0958";
logging-data="425707"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2d+HvPUNksWxnEtA0/Dp0"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:vBO6aNwGJhD+Jx8h1E1syvOVJeo=
sha1:TSmTGpgv8I1PU3moE8vv6sRXH3E=
 by: Alan Bawden - Thu, 4 Apr 2024 02:15 UTC

Paul Rubin <no.email@nospam.invalid> writes:

Alan Bawden <alan@csail.mit.edu> writes:
> But when McCarthy was inventing Lisp, nobody thought that pure Lambda
> Calculus was anything like a programming language.

Ah ok, that was before my time. I had been under the impression that
Lisp had started as lambda calculus with some concessions to
practicality added.

https://en.wikipedia.org/wiki/Lisp_(programming_language)#History

gives that impression too.

It's a common misconception that McCarthy was trying to turn Lambda
Calculus into a programming language. But if you read what he was
writing at the time you will find that he was actually trying to turn
First Order Predicate Calculus (FOPC, i.e. Mathematical Logic) into a
programming language. He added LAMBDA (and LABEL) because he needed
LAMBDA in order to define recursive functions, but as he himself often
admitted, he didn't really understand Lambda Calculus, he just needed
the notation. He _did_ understand FOPC.

Once you understand his true goal, a lot of history becomes more clear.
For example, it explains why McCarthy often talked about conditional
expressions as such an important idea, while he devoted much less ink to
lambda expressions. From our point of view it's clear that adding
LAMBDA to a programming language was more significant then adding COND,
but that's not how he saw things at the time.

It also explains how Common Lisp wound up being a Lisp-2. We have
separate namespaces for functions and values because that's how FOPC
works, so that's how Lisp 1.5 was supposed to work. (It doesn't
_actually_ work that way, but it's clear from the manual that that's how
you're supposed to think about it!) Most Lisps followed Lisp 1.5 down
that path.

> It's only since then that we've done the work to make that practical.

Does Scheme not count? I think lazy evaluation is not needed since the
input to the Church boolean (I hope I have the jargon right) is two
lambda abstractions. The boolean selects one of them, and the result is
applied to whatever the next thing is.

When I wrote "make that practical" I was referring to using Lambda
Calculus _directly_ as a practical programming language. And no, I
don't think that Scheme lets you do that. Even ignoring how
inconvenient it would be to wrap lambdas around both arms of all your
conditionals, the big problem is what do you do about side effects like
I/O? You really need Monads (or something like them) in order to make
that work, and it wasn't until sometime in the 1980s that anybody
figured that out. And I'm not even sure that Haskel (for example)
counts as using Lambda Calculus directly as a programming language. It
seems like there are a lot of ideas knocking around in Haskel that are
well beyond what Church invented!

But all this happened well after McCarthy developed Lisp. If you had
told anyone in 1960 that they should look to Lambda Calculus for useful
insights into how to design a programming language, they probably would
have thought it was just about as relevant as Turing Machines are to
designing actual computing hardware -- perhaps not completely
irrelevant, but not a very practical.

- Alan

Re: Lisp history: IF, etc.

<86v84xoo69.fsf@williamsburg.bawden.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10795&group=comp.lang.lisp#10795

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Wed, 03 Apr 2024 22:29:50 -0400
Organization: ITS Preservation Society
Lines: 17
Message-ID: <86v84xoo69.fsf@williamsburg.bawden.org>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org> <uukr0q$7l0i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Apr 2024 02:29:51 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="e07f213705933abd0291280324cd0958";
logging-data="425707"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DGhvUINL409bgvqmOpUV/"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:KVkbL08m3YoI2XC7N+p68Phino8=
sha1:Osr5SZN6ApTKUpvZsoRX1qRht/0=
 by: Alan Bawden - Thu, 4 Apr 2024 02:29 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

On Wed, 03 Apr 2024 14:15:14 -0400, Alan Bawden wrote:

> Other programming languages at the time (e.g. FORTRAN and ALGOL) only
> had conditional statements.

Algol60 had if-expressions, e.g.

a := if b then c else d

Ah yes, the history is slightly more complicated than I remembered.
Algol 58 did not have conditional expressions. But McCarthy then joined
the Algol committee and he suggested that they add conditional
expressions. And so they do appear in Algol 60.

- Alan

Re: Lisp history: IF, etc.

<20240403204733.866@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10796&group=comp.lang.lisp#10796

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 4 Apr 2024 03:53:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20240403204733.866@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org> <uukr0q$7l0i$1@dont-email.me>
<86v84xoo69.fsf@williamsburg.bawden.org>
Injection-Date: Thu, 04 Apr 2024 03:53:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c584e056168df3e72ae6023a5eb1af29";
logging-data="461039"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hk2ES1/OGRbqIupyx+TBWvmtI+TfTd58="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:oxZSbVQzNHcNOxRR2jj826/WGM8=
 by: Kaz Kylheku - Thu, 4 Apr 2024 03:53 UTC

On 2024-04-04, Alan Bawden <alan@csail.mit.edu> wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
> On Wed, 03 Apr 2024 14:15:14 -0400, Alan Bawden wrote:
>
> > Other programming languages at the time (e.g. FORTRAN and ALGOL) only
> > had conditional statements.
>
> Algol60 had if-expressions, e.g.
>
> a := if b then c else d
>
> Ah yes, the history is slightly more complicated than I remembered.
> Algol 58 did not have conditional expressions. But McCarthy then joined
> the Algol committee and he suggested that they add conditional
> expressions. And so they do appear in Algol 60.

Aha, that could also be the source of the idea that MacCarthy came up
with the ternary IF. (Is it documented whether he actually suggested the
three-operand one, or something more COND like that the committee
whittled down to the above form?)

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

Re: Lisp history: IF, etc.

<20240403211041.911@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10797&group=comp.lang.lisp#10797

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 4 Apr 2024 04:28:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <20240403211041.911@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
Injection-Date: Thu, 04 Apr 2024 04:28:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c584e056168df3e72ae6023a5eb1af29";
logging-data="478417"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18I/WThzvRDNcJfxkJvvWCwhoYLH9RATR4="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:JMkuD0bjKiBLy6BEzjN0F8rwGDs=
 by: Kaz Kylheku - Thu, 4 Apr 2024 04:28 UTC

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

Re: Lisp history: IF, etc.

<8734s17i0h.fsf@axel-reichert.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10798&group=comp.lang.lisp#10798

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mai...@axel-reichert.de (Axel Reichert)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 04 Apr 2024 08:34:54 +0200
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <8734s17i0h.fsf@axel-reichert.de>
References: <uu54la$3su5b$6@dont-email.me> <20240329084454.0000090f@gmail.com>
<uu6om5$cmv8$1@dont-email.me> <20240329101248.556@kylheku.com>
<uu6t9h$dq4d$1@dont-email.me> <20240329104716.777@kylheku.com>
<uu8p02$uebm$1@dont-email.me> <20240330112105.553@kylheku.com>
<uudrfg$2cskm$1@dont-email.me> <87r0fp8lab.fsf@tudado.org>
<uuehdj$2hshe$1@dont-email.me> <87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org>
<871q7m3wrj.fsf@nightsong.com> <uukr74$7l0f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Apr 2024 06:34:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="772b00bf3535f541192abb93f69ce2dc";
logging-data="530369"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196W7CHxhGTydyJZVvrWiZVS5dIkXBfXlo="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:CtJMPQhftphRN1BWHqElnRoJ3zo=
sha1:XIxeSBPUF/n9v8hWsr6jHkYaQF8=
 by: Axel Reichert - Thu, 4 Apr 2024 06:34 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> I use this in Python, to try to avoid that abortion that is the Python
> conditional expression. Instead of, say,
>
> a = x / y if y != 0 else 0
>
> I would do
>
> a = (lambda : 0, lambda : x / y)[y != 0]()

Do you use this in real code?

Apart from my stomach revolting against this (interesting!) construct, I
am in fact surprised that it works: I did not know that tuples can be
indexed by boolean values (feels C-like). I am also surprised that True
"equals" to 1 in this context and False to 0 (rather not C-like).

Could you please give some pointers about the rationale (or further
documentation) here?

Best regards

Axel

Re: Lisp history: IF, etc.

<uulj93$gf7c$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10799&group=comp.lang.lisp#10799

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 4 Apr 2024 07:01:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uulj93$gf7c$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me>
<20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com> <86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org> <875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org> <871q7m3wrj.fsf@nightsong.com>
<uukr74$7l0f$1@dont-email.me> <8734s17i0h.fsf@axel-reichert.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 07:01:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b2ebab76618f2906d24b8f2b6b05668a";
logging-data="539884"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VglG2bfszFq5t5pmsmMWN"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:GbGCLJm9pSywyuECHUSoLlVCDxU=
 by: Lawrence D'Oliv - Thu, 4 Apr 2024 07:01 UTC

On Thu, 04 Apr 2024 08:34:54 +0200, Axel Reichert wrote:

> Could you please give some pointers about the rationale (or further
> documentation) here?

It also generalizes to a switch-expression. Languages nowadays commonly
have switch-statements, but switch-expressions are rarer. Also they are
invariably of the labelled form, while earlier languages (like Algol 68)
had the unlabelled form. My technique for switch-expressions supports both
forms.

Have a look at the “Simple Code-Shortening Idioms” notebook in this
collection <https://gitlab.com/ldo/python_topics_notebooks/>.

Re: Lisp history: IF, etc.

<87sf0138nk.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10800&group=comp.lang.lisp#10800

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp history: IF, etc.
Date: Thu, 04 Apr 2024 00:10:39 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <87sf0138nk.fsf@nightsong.com>
References: <uu54la$3su5b$6@dont-email.me> <uu6om5$cmv8$1@dont-email.me>
<20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me>
<20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me>
<20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me>
<87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me>
<87wmpg7gpg.fsf@tudado.org>
<LISP-20240402085115@ram.dialup.fu-berlin.de>
<20240402084057.881@kylheku.com>
<86h6gjpq3i.fsf_-_@williamsburg.bawden.org>
<m3frw2vlok.fsf@leonis4.robolove.meer.net>
<86cyr6pb2l.fsf@williamsburg.bawden.org>
<875xwy412p.fsf@nightsong.com>
<868r1up0wk.fsf@williamsburg.bawden.org>
<871q7m3wrj.fsf@nightsong.com> <uukr74$7l0f$1@dont-email.me>
<8734s17i0h.fsf@axel-reichert.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Apr 2024 07:10:44 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fb66b83d920913d8a6d24a22d297cd2f";
logging-data="545621"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/abkgxHE8YbWY5orU1WM0m"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:edM55en7DQOt7JaiH/OeMtmMGo4=
sha1:GLw9idtrZSr9Ofl2iAW4pJBE20k=
 by: Paul Rubin - Thu, 4 Apr 2024 07:10 UTC

Axel Reichert <mail@axel-reichert.de> writes:
> I am also surprised that True "equals" to 1 in this context and False
> to 0 (rather not C-like).

There is a hacky thing with that, because the boolean type wasn't added
to Python til fairly late in its history.

> Could you please give some pointers about the rationale (or further
> documentation) here?

For a long time the Python developers refused to have a conditional
expression in the language, preferring the kludgy

a = y and x/y

or other bug-prone hacks of that sort. The danger was that all sorts of
null values such as 0, 0.0, None, the empty list, all are treated as
false for boolean expression purposes, so you could end up getting
fooled by one of those cases. The hack with lambdas was a way to
express the actually desired behaviour though I didn't realize anyone
used it in practice.

Later, the Python interpreter itself fell fictim to such a bug, and
that's when the conditional expression finally got accepted.

I use Python all the time and it is very pleasant, but very often its
decisions are initially driven by what is convenient to implement in
CPython (the reference interpreter, written in C). So various kludgy
practices develop that often must be cleaned up sometime later.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor