2010-06-06 | Paul Boddie | file changeset files shortlog | Changed the function/lambda support to generate special function instances for both kinds of function where the defaults are dynamic. Added support for testing dynamic defaults and for the strict constant nature of non-dynamic attributes. Consolidated the function declaration and definition code generation routines. |
paul@329 | 1 | #!/usr/bin/env python |
paul@329 | 2 | |
paul@329 | 3 | def a(x): |
paul@329 | 4 | def b(p=x): |
paul@329 | 5 | return p |
paul@329 | 6 | return b |
paul@329 | 7 | |
paul@330 | 8 | f2 = a(2) |
paul@330 | 9 | f3 = a(3) |
paul@330 | 10 | |
paul@330 | 11 | result_2 = f2() |
paul@330 | 12 | result_3 = f3() |
paul@329 | 13 | |
paul@329 | 14 | # vim: tabstop=4 expandtab shiftwidth=4 |