Some notes WRT objects and classes

Skip to first unread message

Leopold Toetsch

Oct 22, 2003, 9:15:05 AM10/22/03
to P6I
I already mentioned, that the classname PMC is in different slots, which
could have implications on getting at it.

Here are some more thoughts:

Class/Object Array Layout:

Class Object
Arraytype OrderedHash Array
[ 0 ] parent array class ptr
[ 1 .. 3 ] like now empty
[ 4 ] classname classname
[ 5+ ] class-attribs attributes

Using an OrderedHash for the class array would allow named and indexed
access to static/class attributes. And a class could probably serve as
its own singleton with that layout above.
If object attributes happen to be queried by name at runtime, the object
array could be an OrderedHash too.
Using an OrderedHash addtionally gives named access to the class arrays
"standard" members (which might be useful for Pie-Thon - if not
properties are used their):

class_array ["_parent_array"] = Px #0
class_array ["_class_name"] = Py #4
casss_array ["foo"] = Pz #5 class attrib "foo"

Just some thoughts,

Reply all
Reply to author
0 new messages