proposed syntax for multiline anony-functions (hopefully?)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Aug 23 05:20:49 EDT 2014


Travis Griggs wrote:

> I do not like the python lambda. For two reasons.
> 
> One: In a language that sought to be approachable by simple people (i.e.
> non computer science graduates who would use it in addition to their
> scientific/education background), I can’t believe they threw in a 6
> character  phonetic description of a greek character to imply “fragment of
> code expression to be executed in a removed context”. Show a subset of
> keyword.kwlist to a non-comp-sci guy and tell me if when they see the
> ‘lambda’ betwixt the others, they don’t stop and think “huh, one of these
> is not like the others”.

Ha :-)

The reason lambda is called lambda is that a Lisp fan added it, way back in
the early days of Python, and Guido didn't notice until it was added. In
functional programming circles, lambda comes from the lambda calculus, a
branch of pure mathematics.

But I'm not concerned about the name "lambda". It's no more jargon
than "closure", "coroutine", "continuation", "class" [hmmm, what's with all
the C words?] or "comprehension". And besides, now as an English speaker,
you get to feel the tiniest glimpse of what it is like to be a non-English
speaking programmer forced to use these mysterious keywords `if`, `return`,
`while`, `raise` and similar.


> Personally, I don’t think the desire to use lines as statement boundaries
> (something I like a lot) and at the same time to tersely pack multiple
> statements into a deferred code fragment, are reconcilable. And I don’t
> think there’s critical mass desire for them. So this subject will continue
> to resurface regularly. 

Agreed!



-- 
Steven




More information about the Python-list mailing list