| parrotcode PMC Operations | |
| Docs | FAQ | Download | Examples | Talks | Resources | Perl 6 | Languages | Who's Who | Donors | Cage Cleaners | Wiki | |
pmc.ops - PMC Operations
Operations that deal with PMCs, including creation and destruction, manipulation, and introspection.
These operations are used to create PMCs and examine type information.
Instantiate a new object from a string PMC or key name, or from a class object. For strings and keys, first check the namespace for a class object, then fall back to the type ID if no class object is stored in the namespace.
Creating a new PMC by type ID is deprecated. See RT #48014.
new P0, 'ResizableBooleanArray'
Optionally a PMC may be passed to the constructor. It's up to the class what to do with the intializer. See PDD02 for more.
Return the type of PMC in $2.
Return the type of the entry in aggregate PMC in $2 at key $3.
Return the (native) Parrot type of datatype $2.
Find the PMC type or Parrot datatype by name.
Check if the PMC type or Parrot datatype $2 is valid.
Set $1 to a string representation of $2
A few simple and common PMC operations.
Looks up method $3 in $2's vtable, placing the corresponding method PMC in $1.
Test PMC for definedness.
Tests whether KEY or INTKEY exists in the aggregate PMC. Places the answer in INT.
Delete the specified entry $2 from aggregate $1.
Returns the number of items in aggregate $2
The fast access ops are shortcuts to common operations implemented invar PMCs.
Push $2 onto the end of the aggregate PMC $1, if that operation is defined.
Pop off last entry in the aggregate $2, placing the result in $1.
Unshift $2 onto the front of the aggregate PMC $1.
Shift off the first entry in the aggregate $2 and places it in $1.
Ops to deal with PMC properties.
Set property $2 to value $3 for PMC $1.
Get property $2 of PMC $3 and put it in $1.
Delete property $2 from PMC $1.
Get a hash for the properties invar PMC $2 and put it in $1. If the property hash doesn't exist, the Null PMC is returned.
Ops to PMC freeze, thaw.
Set $1 to the frozen image of $2.
Set $1 to a newly created PMC from the image $2.
These functions manipulate the vtable MMD function table.
These functions allow bytecode to register subs or methods and query which sub or method would get called for a particular vtable operation. This way you're not required to drop to C to register a new method variant for addition or subtraction, or one of the other binary MMD operations.
Register method $4 as the MMD method for vtable entry $1 for classes $2 and $3.
Find the sub that would be called for vtable entry $2 for types $3 and $4.
Add a reference of PMC $1 to the interpreter's root set of PMCs. This is needed for extensions to make sure that the PMC is properly marked during DOD, if that PMC is not known to Parrot's core elsewhere.
A PMC can be registered multiple times. If it's unregistered and the registration count reaches zero, it will be destroyed during the next DOD run.
Remove one reference of $1.
Set $1 to the mro array of the PMC $2. Please note that this is a direct reference so messing with it can do harm to the method lookup.
Copyright (C) 2001-2008, The Perl Foundation.
This program is free software. It is subject to the same license as the Parrot interpreter itself.
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|