Re: Context, wrappers, and rules

2004-12-17 Thread Leopold Toetsch
Sam Ruby wrote: Leopold Toetsch wrote: You'd need in pyclass.pmc: PMC* get_repr() { return pmc_new_string( ... class ...) } In this case, there is a Python specific default. In other cases, there are other Python specific behaviors like mapping not found to an exception or to None.

Re: Context, wrappers, and rules

2004-12-16 Thread Leopold Toetsch
Sam Ruby wrote: Leopold Toetsch wrote: Only function calls / returns may change the context. A simple opcode like get_repr isn't allowed to do that. The question isn't about what opcodes are or are not allowed to do. The question is what VTABLE_* functions are or are not allowed to do. Can

Re: Context, wrappers, and rules

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Parrot_PyClass_get_repr is one such wrapper. How could it be done better? If you make a specific suggestion there, I'll either adopt it or produce a test case as a counter example. You'd need in pyclass.pmc: PMC* get_repr() { return pmc_new_string( ... class

Re: Context, wrappers, and rules

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: On the other hand, if runops can't change the context, then why is runops_args careful to capture the context prior to calling runops? Crunops is a low-level function that awaits all properly setup. Around that are more function that e.g. create a return continuation and

Context, wrappers, and rules (was: cvs commit: parrot/ops pmc.ops)

2004-12-16 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby wrote: Before this line is executed, (gdb) p interpreter-ctx.bp $1 = (struct parrot_regs_t *) 0x40b6bd88 After the above line is executed: (gdb) p interpreter-ctx.bp $2 = (struct parrot_regs_t *) 0x40b6bae8 Then is obviously your implementation of get_repr