Guido van Rossum wrote:

> To those people who believe that lambda is required in some situations
> because it behaves differently with respect to the surrounding scope
> than def: it doesn't, and it never did. This is (still!) a
> surprisingly common myth. I have no idea where it comes from; does
> this difference exist in some other language that has lambda as well
> as some other function definition mechanism?

Not that I know of. Maybe it's because these people first
encountered the concept of a closure in when using lambda in
Lisp or Scheme, and unconsciously assumed there was a
dependency.

> Parting shot: it appears that we're getting more and more
> expressionized versions of statements: ...
 > Perhaps we could add a try/except/finally
> expression, and allow assignments in expressions, and then we could
> rid of statements altogether, turning Python into an expression
> language. Change the use of parentheses a bit, and... voila, Lisp! :-)
> <duck>

Or we could go the other way and provide means of writing
all expressions as statements.

   call:
     foo
     x
     lambda y,z:
       w =:
         +:
           y
           z
       print:
         "Result is"
         w

<counter-duck>

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | Carpe post meridiam!                 |
Christchurch, New Zealand          | (I'm not a morning person.)          |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to