I've figured it out, it is default argument.
print  y()
gives 13 as result.

It's a bit evil though.
I hope this post will be useful some newbie like i'm now someday :)

On Jan 10, 7:25 pm, "[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?
> I thought it bounds the outer variables, so I experimented a little
> bit:
>
> #################
> x = 3
> y = lambda x=x : x+10
>
> print y(2)
> ##################
>
> It prints 12, so it doesn't bind the variable in the outer scope.

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

Reply via email to