At 1:51 PM -0500 2/25/04, Simon Glover wrote:
 Currently, calling get_integer on a ParrotClass returns the attribute
 count, so you can do:

    newclass P1, "Foo"
    addattribute P1, "foo_i"
    addattribute P1, "foo_j"
    set I1, P1
    print I1

 and the code will print '2'. Will this be part of the new API, or is it
 simply a relic of the previous implementation.

Relic.


 Similarly, calling get_integer_keyed_str with a fully-qualified attribute
 name returns the attribute offsets, meaning that this:

    newclass P1, "Foo"
    addattribute P1, "foo_i"
    addattribute P1, "foo_j"
    set I2, P1["Foo\x00foo_j"]
    print I2

prints '1' -- is this part of the API or not?

Relic.


 Finally, a number of the current tests seem to rely on being able to
 set and get attribute values with the syntax:

    set P2["Foo\x00i"], 10
    set P3["Foo\x00i"], 20
    set I2, P2["Foo\x00i"]
    set I3, P3["Foo\x00i"]

 (where P2, P3 are objects of class Foo, and Foo has an attribute i).
 Is this part of the API?

Relic.


In all these cases the object will ultimately do a method lookup to see if it has a method in place to do the operation, so you can substitute an object for any other sort of PMC. Attribute access should be only through the attribute API.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to