Sub PMC should support getattribute #525

Open
aghast opened this Issue Feb 13, 2010 · 2 comments

Comments

Projects
None yet
2 participants

aghast commented Feb 13, 2010

The Sub PMC identifies itself, under class, as being an instance of the Class class.

Querying the Sub's Class for available attributes ($class.inspect('attributes')) returns a hash just chock full of goodness.

Sadly, attempting to request those attribute from the Sub doesn't work.

I believe that Sub should deliver on its promises, and provide the getattribute interface.

Alternatively, if Sub is going to require inspect to fetch the data, then the PMC class should not report those fields as attributes.

Originally http://trac.parrot.org/parrot/ticket/1442

aghast commented Feb 14, 2010

Here's what I'm talking about:

austin@andLinux:~/kakapo$ cat test.nqp
Foo::foo();
module Foo;
sub foo() {
    my &sub := Foo::foo;
    my $class := pir::class__PP(&sub);
    my %attrs := $class.inspect('attributes');
    for %attrs {
        say($_);
    }
}
austin@andLinux:~/kakapo$ parrot-nqp test.nqp
outer_ctx
method_name
name
proxy
eval_pmc
HLL_id
namespace_name
ctx
namespace_stash
ns_entry_name
lex_info
vtable_index
subid
outer_sub
multi_signature
Member

bacek commented Mar 23, 2010

Actually, values from Sub.inspect should be used in Sub.inspect_str, not Sub.getattribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment