Lambda Forms Question

Scott Weisel sweisel at drew.edu
Wed Oct 18 20:13:53 EDT 2000


I'm working with Python on a school project and while I was reading the
documentation I was quite surprised to find out that Python has some
features of Lisp.  Since we're using Scheme, a variant of Lisp in class, I
was hoping to use the Lisp feature in Python, but I'm having trouble
implementing it.  

The example that the online documentation gives is
def make_incrementor(n):
         return lambda x, incr=n: x+incr
which returns a function.  Is there any way to write the program so a value
is returned, rather than a function.  

Also, how do I write the functions by themselves.  I wrote
lambda x: x*x
but I have no way to call it. 

Any advice would be appreciated
Thanks in advance
-Scott



More information about the Python-list mailing list