On Wed, May 11, 2005 at 09:19:50AM +0200, Leopold Toetsch wrote:
> 2) named access
> 
>   x = getattribute o, "Point\0x"
> 
> This needs a full qualified attribute name "Class" ~ NUL ~ "Attribute".
> That's unusable for at least Python and probably more HLLs as the
> compiler has to know in which class the attribute was defined.

Yes.  I've encountered this during my PGE::Hs hacking:

    .const string PGE_SUB_POS = "PGE::Match\x0@:capt"
    .const string PGE_SUB_NAMED = "PGE::Match\x0%:capt"

I had no idea why the class name has to be fully qualified
for attributes, whilst methods can be simply invoked.

Pugs would have no easy way to figure out, at runtime,
which attribute to dispatch to, as Perl 6 allows adding
new attribute slots by eval'ing "class Foo { has $.x }"
blocks, so attributes previously resolved as belong to a
superclass may need to be redispatched.

> We should just have:
>   x = getattribute o, "x"
> and the set equivalent:
>   setattribute o, "x", x

It'd definitely be better if the VM can keep track of
this; otherwise I'd need to marshall the whole attribute
table and do a lookup each time by hand, which would be
slow (and non-interoperable) indeed.

Thanks,
/Autrijus/

Attachment: pgpRQt7SPjRF1.pgp
Description: PGP signature

Reply via email to