Lichen

Annotated tests/nested_lambda.py

886:43f7a46d1e0d
2019-02-01 Paul Boddie Merged changes from trailing-data. float-preallocation
paul@2 1
a = 4
paul@2 2
paul@2 3
def f(x):
paul@266 4
    #   f.$l0          f.$l0.$l0
paul@43 5
    g = lambda y, x=x: lambda z, x=x, y=y: (x, y, z, a)
paul@2 6
    return g
paul@2 7
paul@266 8
print f                 # __main__.f
paul@266 9
print f(1)              # __main__.f.$l0
paul@266 10
print f(1)(2)           # __main__.f.$l0.$l0
paul@266 11
paul@2 12
result = f(1)(2)(3)
paul@214 13
print result[0]
paul@214 14
print result[1]
paul@214 15
print result[2]
paul@214 16
print result[3]
paul@266 17
print result            # (1, 2, 3, 4)