2008-08-03 | Paul Boddie | file changeset files shortlog | Changed the treatment of boolean status (for tests and conditional jumps) such that a special status register would be involved and that the current value would be preserved. Added a LoadBoolean instruction, which loads the boolean status into the current value (using the appropriate object). Changed temporary storage usage for lambda definitions with default values, removing the ensure_temp method. Re-introduced and cleaned up temporary storage usage (and local usage) attributes for program units. |
paul@62 | 1 | #!/usr/bin/env python |
paul@62 | 2 | |
paul@66 | 3 | x = 123 |
paul@66 | 4 | |
paul@62 | 5 | def f(a, b, c=4): |
paul@62 | 6 | pass |
paul@62 | 7 | |
paul@62 | 8 | f(1, 2, 3) |
paul@62 | 9 | f(1, b=2, c=3) |
paul@62 | 10 | f(c=3, b=2, a=1) |
paul@62 | 11 | f(1, 2) |
paul@62 | 12 | |
paul@62 | 13 | g = f |
paul@62 | 14 | g(1, c=3, b=2) |
paul@62 | 15 | g(1, 2) |
paul@62 | 16 | |
paul@62 | 17 | def g(a, c, b=5): |
paul@62 | 18 | pass |
paul@62 | 19 | |
paul@62 | 20 | g(1, c=3, b=2) |
paul@62 | 21 | g(1, 3) |
paul@62 | 22 | |
paul@66 | 23 | def h(a, b, c=f(1, 2, 3)): |
paul@66 | 24 | pass |
paul@66 | 25 | |
paul@66 | 26 | h(1, 2, 3) |
paul@66 | 27 | h(1, 2) |
paul@66 | 28 | |
paul@62 | 29 | # vim: tabstop=4 expandtab shiftwidth=4 |