Deutsch   English   Français   Italiano  
<87sf0138nk.fsf@nightsong.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Paul Rubin <no.email@nospam.invalid>
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=
Bytes: 2935

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.