Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Interface get_pmc_keyed on ParrotInterpreter does not really use invocant #1019

Util opened this Issue Nov 2, 2013 · 0 comments


None yet
1 participant

Util commented Nov 2, 2013

Reported by: zefram@fysh.org

The get_pmc_keyed interface on ParrotInterpreter objects doesn't return information about the interpreter represented by its invocant, but about the currently running interpreter. Example:

$ cat t59.pir
.sub foo
        $P0 = get_global "maininterp"
        $P1 = $P0["sub"]
        say $P1
        .return ()
.sub main :main
        $P0 = getinterp
        set_global "maininterp", $P0
        .const "Sub" foo = "foo"
        $P1 = new "Task", foo
        schedule $P1
        sleep 0.1
$ ./parrot t59.pir

What I said in previous bug report about the "recursion_limit" method applies here too: reading these data about the state of the currently running interpreter are perfectly reasonable operations to support, but they should be presented as opcodes or as standalone subroutines. It is highly misleading to present them as methods on some invocant object that is unrelated to the operation. On the other hand, if there is to be this querying interface on interpreter objects, it should operate on the interpreter represented by its invocant. (It's also fine to have both types of interface, as long as each is individually in a sensible form.)


Summary of my parrot 5.7.0 configuration:
  configdate='Sat Oct  5 12:42:43 2013 GMT'
    osname=linux, archname=x86_64-linux-gnu-thread-multi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment