Abe,
Here's some information regarding closures in Python (the wiki page
goes into the limitation of lambda calc in python. Hope it helps.
Maybe the rest of you CSSA'ers will find it somewhat interesting.
1) From:http://en.wikipedia.org/wiki/Python_syntax_and_semantics
First-class functions
In Python, functions are first-class objects that can be created and
passed around dynamically.
Python's limited support for anonymous functions is the lambda
construct. Since the availability of full anonymous functions is
non-existent then named functions is the primary use of functions in
Python. Lambdas are limited to containing expressions rather than
statements, although control flow can still be implemented less
elegantly within lambda by using short-circuiting.[1]
Closures --
Python has had support for lexical closures since version 2.2.
Also see:
2) http://gnosis.cx/publish/programming/charming_python_13.html
3) http://www.secnetix.de/olli/Python/lambda_functions.hawk
Sincerely,
- Michael E. Karpeles
--
UVM ACM Chapter
CSSA Vice President
CSSA Secretary
www.uvm.edu/~mkarpele
|