2018-07-21 | Paul Boddie | file changeset files shortlog | Invocations in parameter lists may require temporary storage for contexts and accessors, but the storage locations must be different. Otherwise, the code will generate a sequence-point warning. Here, distinct ranges for parameters in lists are introduced, and accessors are now also stored in arrays, permitting distinct storage. |
paul@2 | 1 | def f(x): |
paul@43 | 2 | def g(y, x=x): |
paul@2 | 3 | while 1: |
paul@43 | 4 | def h(z, x=x, y=y): |
paul@2 | 5 | return x, y, z, a |
paul@2 | 6 | a = 4 # not available for h, available in Python |
paul@2 | 7 | return h |
paul@2 | 8 | return g |
paul@2 | 9 | |
paul@2 | 10 | result = f(1)(2)(3) |
paul@2 | 11 | assert result == (1, 2, 3, 4) |