mdiep@dissonance:~/parrot$ cat test.pir
.sub main :main
$P0 = eval("print \"Foo!\\n\"")
$P0()
end
.end
.sub eval
.param string code
code = ".sub main :main :anon\n" . code
code = code . "\n.end\n"
$P0 = compreg "PIR"
.return $P0(code)
.end
mdiep@dissonance:~/parrot$ parrot test.pir
attempt to access code outside of current code segment
mdiep@dissonance:~/parrot$
This was the cause of some trouble recently for Partcl (although I
didn't get the "attempt to access" error message given here - just
some weird behavior (I think the return jumped to a different
coroutine)).
--
Matt Diephouse
> $P0 = compreg "PIR"
>
> .return $P0(code)
> .end
> mdiep@dissonance:~/parrot$ parrot test.pir
> attempt to access code outside of current code segment
> mdiep@dissonance:~/parrot$
>
> This was the cause of some trouble recently for Partcl (although I
> didn't get the "attempt to access" error message given here - just
> some weird behavior (I think the return jumped to a different
> coroutine)).
Well, the runloop continued after the next statement, which for sure can
give nice effects.
Anyway, this is fixed now (r11896) and the example added as another
tailcall test. Thanks for tracking down the issue.
leo