List comprehension confusion...

Kaz Kylheku kaz at ashi.footprints.net
Mon Feb 10 19:53:18 EST 2003


Lulu of the Lotus-Eaters <mertz at gnosis.cx> wrote in message news:<mailman.1044893710.18636.python-list at python.org>...
> kaz at ashi.footprints.net (Kaz Kylheku) wrote previously:
> |Doh, haven't you ever heard of lambda calculus? Where do you think the
> |term ``lambda'' comes from? It's the greek letter used in the notation
> 
> Yeah... that's why I said as much in the same thread.

You said this:

   In mathematics, it is no problem to express infinite domains and
   ranges (or just large ones); but in programs it is often convenient
to
   express a calculable relationship algorithmically rather than
   statically. 

In other words, mathematics is one domain, programs another.

> |Your arguments about purity are ill-conceived; you are arguing that
> |some kind of semantic purity is supported by the impurity of an
> |idiotic syntax which prevents you from having the same expressivity in
> |a lambda as in a regular function.
> 
> I'm not sure what syntax I am defending.

You said:

    The reason I use lambdas at all is BECAUSE of the lack of return
    statment

In other words, the limitation which prevents a lambda body from
having the full expressivity of the body of an ordinary named function
is so wonderful, that it's in fact your ONLY reason for using lambda.

Classic rationalization at work. ``Not only is the car I just bought
the best possible car I could have bought, but I like it *precisely*
because it can't go over 35 km/h.'' Do a web search for ``cognitive
dissonance''.

I have news for you: other people use lambdas because they want an
anonymous function that captures the lexical environment. There are
other users of a programming language besides you. That some
limitation suits a particular use of yours does not justify it.

> |simply a braindamaged limitation, and one that doesn't exist in some
> |other languages that have lexical closures.
> 
> I don't know what this is supposed to be about. 

The intelligent reading of this is: ``other languages that (also) have
lexical closures''.

> Python has closures, of course.

Really? Has this thread been discussing the syntax of *imaginary*
Python lambda construct or what? Idiot.




More information about the Python-list mailing list