Object - Perl 6 Object class
This file sets up the base classes and methods for Perl 6's object system.
Differences (and conflicts) between Parrot's object model and the Perl 6 model means we have to do a little name and method trickery here and there,
and this file takes care of much of that.
- Perform initializations and create the base classes.
- make_proto(class [,
- Create protoobjects and mappings for
name as the Perl 6 name for the class.
class argument can be a Parrot Class object,
or anything that will obtain a Parrot class via the
- Internal helper method to create a class.
- Internal helper method to create a role.
- Internal helper method to implement the functionality of the does keyword.
- Adds an attribute with the given name to the class.
- Create a new object having the same class as the invocant.
- Returns true if the invocant is of type $class.
- Return the invocant's protoobject.
- Return the invocant's metaclass object (in Parrot,
this is the class object for the invocant).
- Define REJECTS methods for objects (this would normally be part of the Pattern role,
but we put it here for now until we get roles).
- Defines the .true method on all objects via
- Print the object
Protoobjects are described in Synopsis 12,
these are objects that are "empty" instances that differ in definedness and how they respond to certain methods.
- get_string() (vtable method)
- Returns the short name of the class (prototype objects stringify to the short name).
- defined() (vtable method)
- Returns false (prototype objects evaluate as undef).
- Returns the metaclass (Parrot class) of the protoobject.
- Returns the invocant's protoobject,
which in the case of a protoobject is just itself.