NAME ^

object.ops

DESCRIPTION ^

Parrot's library of object ops

callmethodcc(invar PMC, in STR)

Call method $2 with invocant $1 and generate a new return continuation. The invocant ($1) is used for method lookup. The object is passed as the first argument in set_args.

Throws a Method_Not_Found_Exception for a non-existent method.

callmethodcc(invar PMC, invar PMC)

Like above but use the Sub object $2 as method.

callmethod(invar PMC, in STR, invar PMC)

callmethod(invar PMC, invar PMC, invar PMC)

Like above, but use continuation $3 instead of creating a new continuation.

tailcallmethod(invar PMC, in STR)

tailcallmethod(invar PMC, invar PMC)

Make a tailcall to method $2 with invocant $1.

addmethod(invar PMC, in STR, invar PMC)

Adds $3 as a method named $2 to $1.

can(out INT, invar PMC, in STR)

Sets result $1 to the result of the "can" vtable function for PMC $2, given method $3.

does(out INT, invar PMC, in STR)

Sets result $1 to the result of the "does" vtable function for PMC $2, given interface $3.

See "build/pmc2c.pl" in tools for a list of available interfaces.

inline op does(out INT, invar PMC, in STR) :object_base { $1 = $3 ? $2->vtable->does(interp, $2, $3) : 0; goto NEXT(); }

isa(out INT, invar PMC, in STR)

isa(out INT, invar PMC, in PMC)

Sets result $1 to the result of the "isa" vtable function for PMC $2, given class $3.

newclass(out PMC, in STR)

Create a new Parrot-style class, named $2, and puts the new PMC for it into $1.

newclass(out PMC, in PMC)

Create a new Parrot-style class, with the name given in $2 as a key, namespace, or string PMC.

subclass(out PMC, in PMC)

subclass(out PMC, in PMC, in STR)

subclass(out PMC, in PMC, in PMC)

Create a new class, put in $1, that is a subclass of $2. $3, if available and not null, is the name of the new class--if not, the subclass is an anonymous subclass.

subclass(out PMC, in STR)

subclass(out PMC, in STR, in STR)

subclass(out PMC, in STR, in PMC)

Create a new class, put in $1, that is a subclass of the class named $2. $3, if available and not null, is the name of the new class--if not, the subclass is an anonymous subclass.

getclass(out PMC, in STR)

getclass(out PMC, in PMC)

Find the PMC for a class, by name. Deprecated - works with the old class system.

get_class(out PMC, in STR)

get_class(out PMC, in PMC)

Find the PMC for a class, by string name or by key.

class(out PMC, invar PMC)

Get the class PMC for the object in $2 and put it in $1.

addparent(invar PMC, invar PMC)

Add class $2 to the list of parent classes for $1.

removeparent(invar PMC, invar PMC)

Remove class $2 from class $1's list of parents.

addrole(invar PMC, invar PMC)

Compose the role $2 into $1.

addattribute(invar PMC, in STR)

Add the attribute named $2 to the class $1.

removeattribute(invar PMC, in STR) (unimplemented)

removeattribute(invar PMC, in INT) (unimplemented)

Remove attribute $2 from class $1, specified either by name or offset.

getattribute(out PMC, invar PMC, in INT)

getattribute(out PMC, invar PMC, in STR)

Get the attribute $3 from object $2 and put the result in $1.

getattribute(out PMC, invar PMC, in PMC, in STR)

Get the attribute $4 from the parent $3 of object $2 and put the result in $1. (This is useful for storing data for a parent class attribute that is overridden in a child class.) The parent $3 is a class name, namespace, or key PMC.

setattribute(invar PMC, in INT, invar PMC)

setattribute(invar PMC, in STR, invar PMC)

Set attribute $2 of object $1 to $3.

setattribute(invar PMC, in PMC, in STR, invar PMC)

Set attribute $3 of the parent $2 of object $1 to $4. (This is useful for storing data for a parent class attribute that is overridden in a child class.) The parent $2 is a class name, namespace, or key PMC.

classoffset(out INT, invar PMC, in STR)

Returns the offset of the first attribute for class $3 in object $2. Throws an exception if $3 isn't in $2's hierarchy.

inspect(out PMC, in PMC)

Sets $1 to a PMC hash of all introspection data available for $2, keyed on name.

inspect(out PMC, in PMC, in STR)

Sets $1 to a PMC Hash, Array, String, Integer, or Number value with introspection information corresponding to the requested string name.

COPYRIGHT ^

Copyright (C) 2001-2007, The Perl Foundation.

LICENSE ^

This program is free software. It is subject to the same license as the Parrot interpreter itself.


parrot