2008-09-07 | Paul Boddie | file changeset files shortlog | Tidied up the exception code generation to ensure that referenced exceptions are obtained. Fixed the exception handling in the RSVP implementation to test exceptions using the isinstance-like testing employed by the CheckSelf instruction. Introduced additional stacks to ensure that frames and return addresses are properly discarded. Added an "isinstance" flag to the object header details in order to support CheckFrame - this would be efficiently encoded, perhaps in the classcode field, in any low-level implementation. |
paul@59 | 1 | #!/usr/bin/env python |
paul@59 | 2 | |
paul@59 | 3 | class C: |
paul@137 | 4 | def __init__(self, x): |
paul@137 | 5 | pass |
paul@137 | 6 | |
paul@59 | 7 | def f(self, a, b, c): |
paul@86 | 8 | self.g(a) |
paul@87 | 9 | m = self.g |
paul@87 | 10 | m(b) |
paul@86 | 11 | |
paul@86 | 12 | def g(self, x): |
paul@86 | 13 | C.h(self, x) |
paul@86 | 14 | |
paul@86 | 15 | def h(self, p): |
paul@59 | 16 | pass |
paul@59 | 17 | |
paul@137 | 18 | c = C(123) |
paul@59 | 19 | c.f(1, 2, 3) |
paul@59 | 20 | |
paul@59 | 21 | f = c.f |
paul@59 | 22 | f(1, 2, 3) |
paul@59 | 23 | |
paul@59 | 24 | # vim: tabstop=4 expandtab shiftwidth=4 |