Re: [Python-3000] lambda

2008-03-28 Thread Bill Janssen
> As a human, it throws me off -- and so does lambda. Much better to just wr= > ite > > def _square(x): return x**2 > map(square, lst) > Excellent illustration of why you want lambda: no need to keep two more or less meaningless symbol names in sync, in a language which doesn't provide

Re: [Python-3000] lambda

2008-03-28 Thread Jim Jewett
On 3/27/08, Neil Toronto <[EMAIL PROTECTED]> wrote: > Olivier Verdier wrote: > > On 26/03/2008, *Nick Coghlan* <[EMAIL PROTECTED] > > Lambda calculus is a > > well established field of mathematics, so it's a perfectly valid name > > for the construct. > > In my university in Swede

Re: [Python-3000] lambda

2008-03-27 Thread Georg Brandl
Olivier Verdier schrieb: > > > On 26/03/2008, *Nick Coghlan* <[EMAIL PROTECTED] > > wrote: > > I think if I come across a keyword I didn't know in a language I was > learning, I'd look it up to find out what it means. > > > Yes but it doesn't look like a key

Re: [Python-3000] lambda

2008-03-27 Thread Leif Walsh
On Thu, Mar 27, 2008 at 3:13 AM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Leif Walsh wrote: > > On Wed, Mar 26, 2008 at 7:34 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > > > > >> x, y => x + y > > > > If something like this is adopted, I plead that := is chosen. > > No, that would be massively

Re: [Python-3000] lambda

2008-03-27 Thread Neil Toronto
Olivier Verdier wrote: > On 26/03/2008, *Nick Coghlan* <[EMAIL PROTECTED] > Lambda calculus is a > well established field of mathematics, so it's a perfectly valid name > for the construct. > > In my university in Sweden lambda calculus is never taught neither in > pure nor applied m

Re: [Python-3000] lambda

2008-03-27 Thread Olivier Verdier
On 26/03/2008, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > I think if I come across a keyword I didn't know in a language I was > learning, I'd look it up to find out what it means. Yes but it doesn't look like a keyword, does it? It looks like a letter of the greek alphabet to me. :-) The first

Re: [Python-3000] lambda

2008-03-27 Thread Lennart Regebro
On Thu, Mar 27, 2008 at 12:34 AM, Greg Ewing <[EMAIL PROTECTED]> wrote: >x, y => x + y I know this is off topic and that we should stop, but this is actually quite nice. Remember that one for Python 4000. ;) -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58

Re: [Python-3000] lambda

2008-03-27 Thread Greg Ewing
Leif Walsh wrote: > On Wed, Mar 26, 2008 at 7:34 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > >> x, y => x + y > > If something like this is adopted, I plead that := is chosen. No, that would be massively confusing, since := is an assignment operator in some languages, notably Pascal. The => i

Re: [Python-3000] lambda

2008-03-26 Thread Greg Ewing
If this were ever to change, my preference would be to find a syntax that doesn't use a keyword at all. Lambdas are most useful when the body is extremely short. But in those cases, the word 'lambda' itself is nearly as long as the body, which destroys about half the benefit of using it in the fir

Re: [Python-3000] lambda

2008-03-26 Thread Guido van Rossum
What is this discussion doing in python-3000? Please move it to python-ideas. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubs

Re: [Python-3000] lambda

2008-03-26 Thread Nick Coghlan
Olivier Verdier wrote: > There is a dislike of the lambda construction that I just don't > understand. Lambda is very practical in all sorts of situations, like: > lambda x,y: x+y. I just find the name plain silly, that's all. Perhaps > you think that all python programmers or beginners have a L

Re: [Python-3000] lambda

2008-03-26 Thread skip
Folks, How about we not start a complete rehash of lambda? There was a long thread several months (or a year?) ago about this. At that time no useful replacement appeared and Guido decreed the status quo would remain the status quo. Instead of dreaming up clever lambda replacements, maybe take

Re: [Python-3000] lambda

2008-03-26 Thread Lennart Regebro
On Wed, Mar 26, 2008 at 11:32 AM, Olivier Verdier <[EMAIL PROTECTED]> wrote: > Python has a very clear syntax Yup. Except the lambda statement of course. :) (And the clarity of list comprehensions is debateble, but I used them anyway, because they are dead practical, even though it hurts my readab

Re: [Python-3000] lambda

2008-03-26 Thread Olivier Verdier
There is a dislike of the lambda construction that I just don't understand. Lambda is very practical in all sorts of situations, like: lambda x,y: x+y. I just find the name plain silly, that's all. Perhaps you think that all python programmers or beginners have a LISP background, but that's just no

Re: [Python-3000] lambda

2008-03-26 Thread Lennart Regebro
On Wed, Mar 26, 2008 at 10:21 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Some might say that the ugliness of the current syntax is a point in its > favour ;) Well, it stops people using it. That's good. :) > The code will almost always become more readable and self-documenting if > the fun

Re: [Python-3000] lambda

2008-03-26 Thread Nick Coghlan
Lennart Regebro wrote: > On Tue, Mar 25, 2008 at 9:42 PM, Olivier Verdier <[EMAIL PROTECTED]> wrote: >> repeats over and over again: lambda is just synctactic sugar for a function >> definition. Here are suggestion for a new name for lambda, which will much >> better describe what it is, namely a *

Re: [Python-3000] lambda

2008-03-26 Thread Paul Du Bois
> Olivier Verdier wrote: > > Any thoughts about that? Any ideas of other better names than "lambda"? arc uses "fn" On Tue, Mar 25, 2008 at 7:01 PM, Talin <[EMAIL PROTECTED]> wrote: > A while back I created and proposed a patch that would change the syntax > of lambda to be more like a generato

Re: [Python-3000] lambda

2008-03-26 Thread Lennart Regebro
On Tue, Mar 25, 2008 at 9:42 PM, Olivier Verdier <[EMAIL PROTECTED]> wrote: > repeats over and over again: lambda is just synctactic sugar for a function > definition. Here are suggestion for a new name for lambda, which will much > better describe what it is, namely a *function*. More specificall

Re: [Python-3000] lambda

2008-03-25 Thread Talin
Olivier Verdier wrote: > Any thoughts about that? Any ideas of other better names than "lambda"? A while back I created and proposed a patch that would change the syntax of lambda to be more like a generator expression. So instead of writing: lambda x: x * x you would write: (x * x giv

Re: [Python-3000] lambda

2008-03-25 Thread Leif Walsh
On Tue, Mar 25, 2008 at 4:42 PM, Olivier Verdier <[EMAIL PROTECTED]> wrote: > If you ask a scientist, even a computer scientist, what "lambda" means he > will invariably answer that it is a letter in the Greek alphabet. Only a few > people working with lambda calculus will think of "lambda" as bein

Re: [Python-3000] lambda

2008-03-25 Thread Oleg Broytmann
On Tue, Mar 25, 2008 at 09:42:25PM +0100, Olivier Verdier wrote: > Many beginners (included myself) were puzzled by "lambda" the > first time they meet it. It doesn't look as clean as the rest of python How many beginners know the meaning of "list comprehension"? "generator"? "tuple"? Oleg. --

Re: [Python-3000] lambda

2008-03-25 Thread Georg Brandl
Benjamin Peterson schrieb: > Guido once said that he hadn't found a better name. Well, I think > that almost *any* name will do better! ;-) Especially a name that > emphasizes the fact that lambda construction are in fact functions. > This is what Guido repeats over and over again:

Re: [Python-3000] lambda

2008-03-25 Thread Benjamin Peterson
On Tue, Mar 25, 2008 at 3:42 PM, Olivier Verdier <[EMAIL PROTECTED]> wrote: > If you ask a scientist, even a computer scientist, what "lambda" means he > will invariably answer that it is a letter in the Greek alphabet. Only a few > people working with lambda calculus will think of "lambda" as bei