TITLE ^

Object - Cardinal Object class

DESCRIPTION ^

This file sets up the base classes and methods for Cardinal's object system. Differences (and conflicts) between Parrot's object model and the Cardinal model means we have to do a little name and method trickery here and there, and this file takes care of much of that.

Still heavily based off of Perl 6's.

Functions ^

onload()

Perform initializations and create the base classes.

!keyword_class(name)

Internal helper method to create a class.

!keyword_role(name)

Internal helper method to create a role.

!keyword_does(class, role_name)

Internal helper method to implement the functionality of the does keyword.

!keyword_has(class, attr_name)

Adds an attribute with the given name to the class.

Object methods ^

new()

Create a new object having the same class as the invocant.

WHENCE()

Return the invocant's auto-vivification closure.

REJECTS(topic)

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).

true()

Defines the .true method on all objects via prefix:?.

print()

say()

Print the object

to_s()

Return a CardinalString representation of the object.

methods()

Get a list of all methods in the object.


parrot