NAME ^

object.ops

DESCRIPTION ^

Parrot's library of object ops

callmethodcc(in 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(in PMC, in PMC)

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

callmethod(in PMC, in STR, in PMC)

callmethod(in PMC, in PMC, in PMC)

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

tailcallmethod(in PMC, in STR)

tailcallmethod(in PMC, in PMC)

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

fetchmethod(out PMC, in PMC, in STR)

Find the method $3 for object $2 and put it in $1. Throws a Method_Not_Found_Exception for a non-existent method. The returned PMC may be outdated, when the call is actually performed and changes to the underlying classes where made.

can(out INT, in PMC, in STR)

Sets $1 to true or false, depending on whether $2 ->can the method in $3.

does(out INT, in PMC, in STR)

Sets $1 to true or false, depending on whether $2 ->does the interface in $3.

See "pmc2c.pl" in build_tools for a list of available interfaces.

isa(out INT, in PMC, in STR)

Sets $1 to true or false, depending on whether $2 isa $3.

newclass(out PMC, in STR)

Creates a new Parrot-style class, named $2, and puts the new PMC for it into $1. (This is a real out--the contents of $1 are ignored and the pointer for the new PMC is put in there).

subclass(out PMC, in PMC)

subclass(out PMC, in PMC, in STR)

subclass(out PMC, in STR)

subclass(out PMC, in STR, in STR)

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

$1 is replaced--a new PMC for the subclass is generated and put in it.

getclass(out PMC, in STR)

Find the PMC for a class, by name. Note that this is a one-level hash, so for classes that have some structure you need to impose that structure externally.

Parrot's conventions are that level separators are noted with the NULL character, so Perl's Foo::Bar would be Foo\0Bar.

singleton(in PMC) (unimplemented)

Take the object in $1 and put it into its own singleton class, which is an anonymous subclass of the object's current class.

class(out PMC, in PMC)

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

classname(out STR, in PMC)

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

addparent(in PMC, in PMC)

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

removeparent(in PMC, in PMC)

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

addattribute(in PMC, in STR)

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

removeattribute(in PMC, in STR) (unimplemented)

removeattribute(in PMC, in INT) (unimplemented)

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

getattribute(out PMC, in PMC, in INT)

getattribute(out PMC, in PMC, in STR)

Get attribute number $3 from object $2 and put the result in $1. String attribute names have to be fully qualified.

setattribute(in PMC, in INT, in PMC)

setattribute(in PMC, in STR, in PMC)

Set attribute $2 of object $1 to $3

classoffset(out INT, in 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.

adddoes(in PMC, in STR) (unimplemented)

Add $2 to the list of interfaces that this class claims to implement.

removedoes(in PMC, in STR) (unimplemented)

Remove $2 from the list of interfaces that this class claims to implement.

COPYRIGHT ^

Copyright (C) 2001-2004 The Perl Foundation. All rights reserved.

LICENSE ^

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


parrot