Fernando  <[EMAIL PROTECTED]> writes:

> 
> On 15 Mar 2005 00:43:49 -0800, "Kay Schluehr" <[EMAIL PROTECTED]>
> wrote:
> 
> >Maybe You can answer my question what this simple LISP function does ?
> >
> >(defun addn (n)
> >       #'(lambda (x)
> >           (+ x n)))
> 
> The same as 
> def addn(n):
>       def fn(x):
>               return n + x
>       return fn

Is this really equivalent?

What happens if you call addn more than once with different
parameters.  Will you get different functions that you can
use simultaneously?

The lisp snippet creates new functions each time the addn function is
called, so one can interleave calls to the individual functions.

-- 
Thomas A. Russ,  USC/Information Sciences Institute

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to