>>> Jibes against the lambda-clingers lead eventually to serious >>> questions of style in regard to variable namespacing, >>> lifespan, cleanup, and so on: >>> http://groups.google.com/group/comp.lang.python/browse_thread/thread/ad0e15cb6b8f2c32/
Alan Isaac <[EMAIL PROTECTED]> wrote: >> #evaluate polynomial (coefs) at x using Horner's rule >> def horner(coefs,x): return reduce(lambda a1,a2: a1*x+a2,coefs) "Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I *think* you're supporting a claim > about the value of lambda with a specific example. Do I have that > right? Are you saying that your definition of horner() would suffer > greatly without lambda? It is a simple example of how lambda and reduce can be very expressive. Anyone who understands Horner's rule can see at a glance that this code implements it. Anyone who has bothered to learn what lambda and reduce do can see at a glance what the algorithm is. It just cannot get simpler or more expressive. Suffer greatly? Surely not. For "suffer greatly" you would probably need to turn to people who do a lot of event-driven GUI programming. But suffer, yes. Simplicity and expressiveness are valuable. That is the point. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list