[Python-Dev] Let's just *keep* lambda

Christopher Armstrong radeex at gmail.com
Tue Feb 7 08:19:35 CET 2006


On 2/7/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Brett Cannon wrote:
> > But I know that everyone and their email client is against me on this
> > one, so I am not going to really try to tear into this. But I do
> > think that lambda needs a renaming. Speaking as someone who still
> > forgets that Python's lambda is not the same as those found in
> > functional languages
>> Can you elaborate on that point? I feel that Python's lambda is exactly
> the same as the one in Lisp. Sure, the Lisp lambda supports multiple
> sequential expressions (the "progn" feature), but I understand that
> this is just "an extension" (although one that has been around several
> decades).
>> Of course, Python's expressions are much more limited as Lisp's (where
> you really can have macros and special forms in as the "expression"
> in a lambda), but the lambda construct itself seems to be the very
> same one.

If we phrase it somewhat differently, we can see that lambdas are
different in Python and Lisp, in a very practical way. First:
Everything in Lisp is an expression. There's no statement, in Lisp,
that isn't also an expression. Lambdas in Lisp can contain arbitrary
expressions; therefore you can put any language construct inside a
lambda. In Python, you cannot put any language construct inside a
lambda. Python's and Lisp's lambdas are effectively totally different.
+1 on keeping Lambda, +1 on making it more useful.
--
 Twisted | Christopher Armstrong: International Man of Twistery
 Radix | -- http://radix.twistedmatrix.com
 | Release Manager, Twisted Project
 \\\V/// | -- http://twistedmatrix.com
 |o O| |
w----v----w-+


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /