Chromatic
2008-12-16 23:52:49 UTC
The simple solution is to add opcodes for 'setstdin', 'setstdout', and
'setstderr' that change the interpreter's stored FileHandle PMCs to a
PMC passed in as an argument. This will not effect any C code that
directly calls the low-level read/write functions instead of using the
Parrot_io_* functions, but then C code should pretty much always use the
Parrot_io_* functions. (Some exceptions to the general rule apply, like
when the code specifically needs to override any user changes to
STD[IN|OUT|ERR]).
Do these need to be opcodes? Can they be methods on the interpreter instead?'setstderr' that change the interpreter's stored FileHandle PMCs to a
PMC passed in as an argument. This will not effect any C code that
directly calls the low-level read/write functions instead of using the
Parrot_io_* functions, but then C code should pretty much always use the
Parrot_io_* functions. (Some exceptions to the general rule apply, like
when the code specifically needs to override any user changes to
STD[IN|OUT|ERR]).
-- c