26 Apr
2014
26 Apr
'14
8:27 a.m.
On Sat, Apr 26, 2014 at 11:03 PM, Philipp A.
in python, the most similar thing is something like this:
'key1': lambda: eggs += lay_eggs(), #branch 1
Except that lambda doesn't create a code block, it creates a nested function. This example won't work, and nor will anything else that needs to mutate locals; you'd have to declare an out-of-line function (as with branch_2_3) to be able to assign to 'nonlocal eggs'. ChrisA