| parrotcode Experimental Operations | |
| Docs | FAQ | Download | Examples | Talks | Resources | Perl 6 | Languages | Who's Who | Donors | Cage Cleaners | Wiki | |
experimental.ops - Experimental Operations
This file contains operations that are in an experimental state. Do not rely upon the existence of the ops in this file when writing production code. No decision has yet been made as to whether they are accepted as regular Parrot ops or not. They are included here for testing purposes only!
Implementations of various mathematical operations
Greatest Common divisor of $2 and $3.
Given $4 and $5, it calculates $1, $2 and $3 so that
$1 = gcd($4, $5) = $2 * $4 + $3 * $5 (d = gcd(a, b) = x*a + y*b)
Replace $4 values at offset $3 in aggregate $1 with the PMCs in aggregate $2. The values are put into the aggregate by a shallow copy. If the values would be reused, they have to be cloned.
Return a new Iterator PMC $1 for aggregate $2 and Slice PMC $3.
Return a new list PMC $1 for aggregate $2 and Slice PMC $3.
This is a Python opcode. Range is i <= k < j. $4 must be 1. May change and move to python.ops.
Return a new Iterator PMC $1 for aggregate $2.
Have $1 turn itself into a PMC of type $2.
Execute the passed-in command. Completely tosses the current process image and replaces it with the command. Doesn't exit (the program ends, after all), though it does throw an exception if something goes wrong.
Get the class name for the class in $2 and put it in $1. Note that $1 will be a Key PMC that you can use with "new", for example.
trapBreak into debugger. Implementation notes:
- x86/gcc ... works with gdb - ppc/gcc ... works with gdb, to proceed: gdb> p $pc = $pc + 4 - TODO
For other architectures, this is a noop.
Set $1 to $2 raised to the power $3.
Create a new PMC of the type $2 according to the PMCs string representation in $3.
BUT SINCE INSTANTIATE WILL PROBABLY DIE, DON'T USE THIS; OR IF YOU NEED THIS (OR INSTANTIATE), TELL CHIP
Call the sub $2 for PIO $1 with user data $3 on ready state of $4. RT#42376 The only handled $4 = IO_THR_MSG_ADD_SELECT_RD aka 2 for now.
The ParrotObject $1 needs the __finalize method during GC.
Sets the standard output for a bare print op to go to the supplied ParrotIO PMC. Call getstdout first if you care about retaining the previous PMC.
Sets the standard error for a bare printerr op to go to the supplied ParrotIO PMC. Call getstderr first if you care about retaining the previous PMC.
Invokes the PMC $2 using interp $1.
Make $1 refer to the given part of $2, basically like above, but it is reusing the given destination string and does not care if the source string is changed later. This is changed includes also GC runs, which will move the referenced string. This also means that $1 has to be reset before any GC may happen.
This opcode should really be just used to quickly refer to a substring of another part, e.g. for printing and is a temporary hack.
Handle with care.
find_sub_not_null(out PMC, in STR)inline op find_sub_not_null(out PMC, in STR) :base_core { PMC *sub = Parrot_find_name_op(interp, $2, expr NEXT());
if (PMC_IS_NULL(sub))
real_exception(interp, NULL, GLOBAL_NOT_FOUND,
"Could not find non-existent sub %Ss", $2);
$1 = sub;
}
Copyright (C) 2001-2008, The Perl Foundation.
This program is free software. It is subject to the same license as the Parrot interp itself.
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|