checking if a list is empty

rusi rustompmody at gmail.com
Mon May 16 01:40:37 EDT 2011


I have been scolded off-list for pursuing a discussion that has
nothing to do with python.
So I continue a bit gingerly :-)  and will stop when others feel this
is useless/irrelevant/whatever.

Steven wrote:

> I'm afraid I didn't find your discussion about reification, Platonism and
> linguistics very helpful. Some of it I disagree with, some I agree with,
> but in neither case do I see any relevance to the question of whether
> bools are first class objects in Python, and if not, why not.

Thank you (Steven and Terry) for using the word 'reification'. I used
the more common 'firstclass' because I assumed that will be more
generally known. I however prefer reification since one can discuss
(more cooly :-) ) what and how much one should reify; the word
reification has less of a strong value judgment in philosophy than
firstclass has in computer science.

The lead-writeup on reification http://en.wikipedia.org/wiki/Reification_%28computer_science%29
has the following line:
> Informally, reification is often referred to as "making something a first-class citizen" within the scope of a particular system.

So from the CS side reification == movement-towards-firstclassness
>From the philosophical side we could try to define platonism (non-
mystically) as "The strong reification of abstract concepts"

So much for my defense of bringing in platonism into the discussion.

Steven wrote:
>
> > Seemingly you and Dijkstra are saying something similar when you say
> > [1,2,3] is a way of writing true
> > and he says 2<3 is a way of writing true. But on further examination
> > (with Leibniz law above) Dijkstra's 2<3 = True will work consistently in
> > all contexts but [1,2,3] = True will work sometimes and fail sometimes.

> Please do not arbitrarily mix Python and mathematics syntax. What you have stated gives a SyntaxError.

Is this non-mixing-up possible? Like 'reification,' I do not know if
using the funny brackets of denotational semantics would be
intelligible on this list ( and I dont know how to write them in
ASCII) but using |[ ]| as an approximation, I would have to say
something like:

Dijkstra's |[ 2<3 ]| = True will work consistently... Python's |
[ [1,2,3] ]|  = |[True ]| will be be true in boolean contexts and not
elsewhere.
Note that the first |[]| is for the object language called mathematics
and the other two for the object language called python. And the = is
in a pidgin English-math meta language that is need to discuss these
object languages.

I am not clear that this form of discourse actually enhances clarity,
however it does bring up the point that this discussion is as much
about object/meta-language distinctions and confusions as it is about
reification.

You see when Terry talks of boolean algebra for switching networks, he
is referring to logic as an object language.
But when we use logic to discuss and understand (and argue :-) ) we
are using  it in the meta-language.

Dijkstra's signal contribution -- which he attributes to Boole,
Leibniz and Recorde (for the = sign) -- lies in this:
>From the time of Aristotle, all usage of logic in the meta-language
(logic as the substrate for arguments rather than logic as a model for
things like switching networks)  has been a string of assertions
linked up with 'implies' 'therefore' 'follows from' etc.  All these
when modelled (in a suitable object logic) would traditionally look
like => (implies) or at best <= (follows from)

It is possible to do all this -- traditional logic -- using = (aka
iff, <=>, etc)

The benefit is that logic becomes much more like traditional algebra:
Proofs become of the form:

desideradum
=
:
:
= true

The cost is that bool has to be properly reified.

Steven wrote:
> Rusi wrote:
> > For example if my language seems to have entities like '2' '3' '+' but
> > 2+3 does not work out equal to 5 we would (I hope!) not say the language
> > has first-class numbers.

> Well, that's a problem. By that definition, floats are not first class
> numbers. While 2+3 does work out to be equal to 5, other standard
> properties of the real number system do not apply:

> >>> 0.3 + 0.4 - 0.3 == 0.4

>From C onwards (and in Fortran), its been called float, not real.
Note that C like python uses a math-suggesting name int for integers
but a hardware implementation name for float.  This suggests that
(aside from overflow) int in C corresponds to the math Z whereas float
does not quite correspond to real.  [The whole field of numerical
analysis comes about because of this non-correspondence]

In the language Pascal, what we call float today was called real and
this would be an argument.
But in this context I dont get the argument...



More information about the Python-list mailing list