Let's Talk About Lambda Functions!

Donn Cave donn at drizzle.com
Tue Jul 30 01:26:50 EDT 2002


Quoth "Steve Holden" <sholden at holdenweb.com>:
| "Carl Banks" <imbosol at vt.edu> wrote in message
| news:ahuqd8$1a7$1 at solaris.cc.vt.edu...
| [ ... ]
|> Personally, I don't care about saving lines, per se.  For me, lambda
|> helps me to avoid stopping mid-function call, scrolling many or few
|> lines to implement the function as a def, and returning.  I.e.,
|> lambdas save me cursor movement.
|
| Well your programming style and mine are very different. I thought the whole
| point of using functions was to provide a usable abstraction of a portion of
| a program's logic. I therefore *conceptualize* a function long before I
| write it, and don't feel the need to make it's source code explicit just
| because I've caslled it somewhere in my (developing) program.

Perhaps that is indeed the point - abstraction, and control of
abstraction.  I think you will agree that your choice of abstraction
is a key question in your whole program design, not something where
you'd just take all you get, willy-nilly.  Where you want abstraction,
functions are indeed useful.  Where you do not, but you still need a
function, you have lambda.

These would often be functions that are so trivial that they can
more economically simply stand for themselves.  But in any case,
you can ask "what do I get out of abstracting this", and the answer
may just be "nothing".

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list