On Thu, 10 Jan 2008 10:25:27 -0800 (PST) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I'm reading this page: > http://www.ps.uni-sb.de/~duchier/python/continuations.html > and I've found a strange usage of lambda: > > #################### > Now, CPS would transform the baz function above into: > > def baz(x,y,c): > mul(2,x,lambda v,y=y,c=c: add(v,y,c)) > > ################### > > What does "y=y" and "c=c" mean in the lambda function? Older versions of python didn't make variables in an outer scope visible in the inner scope. This was the standard idiom to work around that. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list