[Python-3000] lambda

Jim Jewett jimjjewett at gmail.com
Fri Mar 28 20:08:46 CET 2008


On 3/27/08, Neil Toronto <ntoronto at cs.byu.edu> wrote:
> Olivier Verdier wrote:
>  > On 26/03/2008, *Nick Coghlan* <ncoghlan at gmail.com

> >     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 math.

The relevant math courses may well be graduate-level only, and may (or
may not) be titled something like "logic" or "metamathematics".

>  > applied to linguistics. The word "lambda" however is  used all over the
>  > place as an eigenvalue, or a wave length, or parameter, or Lamé
>  > coefficient in many of our courses.

This is a (minor) problem with any reserved word.  I've seen more
trouble with "class", particularly for assignments to create a
registrar or grading program.

> How about reusing "def" to make a lambda expression?
...
>  By the time someone comes across this:

>      map(def(x): x**2, lst)

>  in code, they've already created plenty of functions using "def", ...
>  can't imagine that it would be *too* difficult to parse

As a human, it throws me off -- and so does lambda.  Much better to just write

    def _square(x):  return x**2
    map(square, lst)

There was enough argument to keep lambda, but *changing* it any way
(except possibly Terry's suggestion to make it a single unicode
character) will just add additional cost.

-jJ


More information about the Python-3000 mailing list