Lambda (was: Augmented assignment)

William Tanksley wtanksle at dolphin.openprojects.net
Mon May 29 20:11:05 EDT 2000


On Sat, 13 May 2000 15:35:33 -0500, Russell Turpin wrote:
>William Tanksley wrote:
>> Guido, for one.  He points out that it doesn't fit into the 
>> language -- its syntax is all wrong, and the scoping rules 
>> you need/want to work with it are very different from the 
>> scoping rules Python enjoys.

>Maybe it would be more pleasing aesthetically if it were
>called something other than lambda?

An interesting question.  I'm not sure how that would work, though.

>I like it in Python, 
>for the very practical reason that it is a nicer way to 
>generate anonymous functions than the alternative. You 
>should not have to create a named function solely for the 
>purpose of spitting out an anonymous function! That often
>defeats the desire to have an anonymous function .. "gee,
>might as well use a named function directly, even if all
>I do is pass it in ..mumble, grumble."

Well, first of all you should note that it's not very pretty and is very
limited.  The only advantage it has is that it's inline, so it can be more
expressive.  The problem is that Python's scoping rules make it generally
too verbose to be included inline.

>> Me?  I hate the whole lambda calculus, not because of 
>> what it is, but because of what many people think it is.  
>> They think that it's the whole of computer science, the 
>> ultimate way to express and reason about programs, when 
>> in reality it's merely a shabby and incomplete model of 
>> how Fortran fails to work. ..

>If you're going to hate the lambda calculus, you should
>at least hate it for the right reasons.

I do, really.  I just don't communicate them well in a rushed post.  My
apologies.

>Second, the lambda calculus IS very important to people who formally
>reason about systems. I have to point this out, since some of the best
>people at doing this -- some of the few doing it commercially! -- are
>friends of mine.

THIS is the problem I have -- it just annoys the heck out of me ;-) that
so many people are stuck with such a special-purpose system of reasoning,
and aren't even _aware_ that there are alternatives.

There's a decent coverage of a couple of those at
http://www.latrobe.edu.au/www/philosophy/phimvt/j08cnt.html (although it's
biased in favor of a specific language, Joy).

>BUT .. if you want to point out that formal reasoning
>about systems is not much of computer science, and has
>very little to do with practical software construction, 
>especially anything as RADdy and convenient as Python, 
>you would be right on the mark.

Grin.  Yes, I've sat through a few Djikstra lectures.  He thinks that it
IS the entireity of CS.  Although I agree with him that it's important, I
agree more with my professor at the time, who said that it's (essentially)
inefficient.

>Russell

-- 
-William "Billy" Tanksley



More information about the Python-list mailing list