lambda versus "mlambda"...

Courageous jkraska1 at san.rr.com
Wed May 10 23:55:42 EDT 2000


Hi, I'm fairly new to python, so what I'm about to talk about might
be utterly mistaken, but I'll take a poke at it, anyway. Here goes.
It occurs to me that "mlambda" might be a nice builtin...

(I have to interrupt to say that if anyone knows a way of doing this
 now, please bonk me on the head).

When I discovered that "pointers to method objects" automatically
encapsulated the instance object within themselves, I thought that
was a very cool thing.

Being exposed to lambda functions from lisp, I also think that, in
certain contexts, map/lambda expressions are powerful and inter-
esting.

However, one of the things that I think would be nice are lambda
*methods*. That is, if you pass a lambda function off using
"mlambda" (a builting I just made up), and this lambda function
is generated in the context of a class or an instance, it would
behave like a method object callable, automatically encapsulating
the method (to wit: upon invocation, the passing of "self" is
assumed).

If this is something I've missed and it's somehow in there already,
someone please point it out. Otherwise, I recommend this for
addition to Python.

Guido's deprication of map/lambda aside, of course. :)-


C/



More information about the Python-list mailing list