Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > better lambda support in the future?

Thread Tools

better lambda support in the future?

Nick Coghlan
Posts: n/a
Bengt Richter wrote:
> It is a little sneaky though, so it might not be prudent to promote
> without a little more experimentation? I just like to explore

I don't think even the py-dev discussions of this settled on whether such tricks
were "very cool" or "downright evil".

They're probably less evil than sys._getframe hacks, though


Nick Coghlan | Removed) | Brisbane, Australia
Reply With Quote
Antoon Pardon
Posts: n/a
Op 2004-12-17, Terry Reedy schreef <(E-Mail Removed)>:
> "Jason Zheng" <(E-Mail Removed)> wrote in message
> news:cpvhee$7uh$(E-Mail Removed)...
>> Steven Bethard wrote:
>>> Jason Zheng wrote:
>>>> I'm wondering why python still has limited lambda support. What's
>>>> stopping the developers of python to support more lisp-like lambda
>>>> function?

> They already have: given the fundamental syntax difference between all
> expressions and expressions within statements, def statements are at least
> the equivalent of lisp lambdas + name binding. When you get an exception
> traceback, a unique name is more helpful than the pseudoname <lambda>.
> Isolating the definition of a function in a separate statement also makes
> it possible to unittest the function.
>>> This comes up every few weeks on the list. If you haven't already,
>>> check the archives in Google for 'anonymous def' or 'anonymous
>>> function'. The usual response to this question is something along the
>>> lines of "if it's good enough to create a function for, it's good enough
>>> to name".

> What puzzles me is 1) why some people apparently think anonymity is good --
> is it really that hard to name non-trivial functions?

Do you name every object, number, string ... before you use it.
If not it seems you don't object to anonymity.

And yes it sometimes is hard. Of course you can just name it f1, f2 etc,
but that is no improvement over anonymity and sometimes the best you
can do is describe what the function does, but the code does that

Antoon Pardon
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Type of lambda function returning a lambda function... Haochen Xie C++ 4 03-17-2013 11:23 PM
lambda vs non-lambda proc Steve Dogers Ruby 1 03-30-2009 10:11 PM
Build a Better Blair (like Build a Better Bush, only better) Kenny Computer Support 0 05-06-2005 04:50 AM
Re: Lambda as declarative idiom (was RE: what is lambda used for inreal code?) Roman Suzi Python 13 01-07-2005 09:33 PM
Re: better lambda support in the future? Jp Calderone Python 2 12-18-2004 07:13 AM