Hi, On Friday 09 April 2004 14:03, Leopold Toetsch wrote: > Jens Rieks <[EMAIL PROTECTED]> wrote: > > On Wednesday 07 April 2004 17:42, Leopold Toetsch wrote: > >> Further, in C<rawRead> P1 is stored away (and invoked later), which > >> isn't allowed. But cloning it doesn't help because the continuation > >> context is still wrong. > > I've this now running. > > $ ../parrot -t --gc-debug examples/streams/SubHello.imc 2>/dev/null > read:[hello] > read:[world!] > read:[parrot] > read:[is cool] > > Where a return continuation is reused the code > should look like: > > $P1 = clone P1 > # store $P1 > > The "clone" for return continuation resets the recycle flag (on both > sides) so that e.g. a Sub can exit through this P1 multiple times. > > The code is quite hackish and I'm still not sure, if we can keep this > optimization, we'll see. I'll check it in now.
There is also a new Stream::Writer, an inside-turned-out version of Stream::Sub. You can call "write" in the normal call chain; the reading is done in the sub one provides. > leo jens