Enclosed patch attempts to resynchronize the core.ops documentation with the actual code. It also fixes a few typos and overlong lines.
Simon --- core.ops.old Sat Jan 19 16:36:59 2002 +++ core.ops Sat Jan 19 18:19:36 2002 @@ -218,8 +218,13 @@ =item B<print>(in INT, in NUM) +=item B<print>(in INT, in STR) + =item B<print>(in INT, in PMC) +Print $2 to the file on $1. (0, 1, and 2 correspond to stdin, stdout, +and stderr) + =cut inline op print(in INT) { @@ -488,19 +493,13 @@ Set $1 to $2. -=item B<set>(out INT, in PMC, in INT) - -=item B<set>(out NUM, in PMC, in INT) - -=item B<set>(out STR, in PMC, in INT) - =item B<set>(out PMC, in INT, in INT) =item B<set>(out PMC, in NUM, in INT) =item B<set>(out PMC, in STR, in INT) -Set $1 to index $1 of array $2 +Set the value stored at index $3 of array $1 to $2. =item B<set>(out INT, in PMC, in INT) @@ -508,13 +507,23 @@ =item B<set>(out STR, in PMC, in INT) -=item B<set>(out PMC, in INT, in INT) +Set $1 to the value stored at index $3 of array $2. -=item B<set>(out PMC, in NUM, in INT) +=item B<set>(out PMC, in INT, in STR) -=item B<set>(out PMC, in STR, in INT) +=item B<set>(out PMC, in NUM, in STR) + +=item B<set>(out PMC, in STR, in STR) + +Set the value associated with key $3 of hash $1 to $2. + +=item B<set>(out INT, in PMC, in STR) -Set $1 to index $3 of hash $2 +=item B<set>(out NUM, in PMC, in STR) + +=item B<set>(out STR, in PMC, in STR) + +Set $1 to the value associated with key $3 of hash $2. =cut @@ -643,7 +652,7 @@ =head2 Conditional branch operations -These opertions perform a conditional relative branch. If the condition is +These operations perform a conditional relative branch. If the condition is met, the branch happens, otherwise control falls to the next operation. =over 4 @@ -783,8 +792,6 @@ =item B<lt>(in NUM, in NUM, in INT) -=item B<lt>(in PMC, in PMC, in INT) - =item B<lt>(in STR, in STR, in INT) Branch if $1 is less than $2. @@ -1321,8 +1328,6 @@ =item B<mul>(out NUM, in NUM, in NUM) -=item B<mul>(n, n, nc) - Set $1 to the product of $2 and $3. =cut @@ -1416,7 +1421,8 @@ Remove $2 characters from the end of the string in $1. -TODO: Create a three-argument version of this? Don't force in-place modification. +TODO: Create a three-argument version of this? Don't force in-place +modification. =cut @@ -1483,8 +1489,8 @@ =item B<substr>(out STR, in STR, in INT, in INT) -Set $1 to the portion of $2 starting at (zero-based) character position $3 and having -length $4. +Set $1 to the portion of $2 starting at (zero-based) character position $3 +and having length $4. =cut @@ -1675,7 +1681,8 @@ =item B<exp>(out NUM, in NUM) -Set $1 to I<e> raised to the power $2. I<e> is the base of the natural logarithm. +Set $1 to I<e> raised to the power $2. I<e> is the base of the natural +logarithm. =cut @@ -1901,7 +1908,8 @@ =item B<and>(out INT, in INT, in INT) -Set the bits of $1 according to the B<and> of the corresponding bits from $2 and $3. +Set the bits of $1 according to the B<and> of the corresponding bits from +$2 and $3. =cut @@ -1929,7 +1937,8 @@ =item B<or>(out INT, in INT, in INT) -Set the bits of $1 according to the B<or> of the corresponding bits from $2 and $3. +Set the bits of $1 according to the B<or> of the corresponding bits from +$2 and $3. =cut @@ -1970,7 +1979,8 @@ =item B<xor>(out INT, in INT, in INT) -Set the bits of $1 according to the B<xor> of the corresponding bits from $2 and $3. +Set the bits of $1 according to the B<xor> of the corresponding bits from +$2 and $3. =cut @@ -2065,7 +2075,7 @@ =head2 Register operations -These operations effect entire sets of registers. +These operations affect entire sets of registers. =over 4 @@ -2224,7 +2234,7 @@ =head2 Register stack operations -These operations effect individual registers. +These operations affect individual registers. =over 4 @@ -2235,7 +2245,7 @@ =item B<entrytype>(out INT, in INT) -Gets the type of entry $2 of the stack and puts in in $1 +Gets the type of entry $2 of the stack and puts it in $1 =cut @@ -2376,7 +2386,8 @@ =cut inline op bsr (in INT) { - stack_push(interpreter, interpreter->control_stack, expr NEXT(), STACK_ENTRY_DESTINATION, NULL); + stack_push(interpreter, interpreter->control_stack, expr NEXT(), + STACK_ENTRY_DESTINATION, NULL); goto OFFSET($1); } @@ -2423,7 +2434,7 @@ =item B<newinterp>(out PMC, in INT) -Create a new interpreter and store it in a PMC +Create a new interpreter and store it in a PMC. =cut @@ -2441,7 +2452,7 @@ =item B<runinterp>(inout PMC, in INT) -Take a built interpreter and run the code starting at offset $2 +Take a built interpreter and run the code starting at offset $2. =cut @@ -2495,7 +2506,7 @@ =item B<sleep>(in INT) -Sleep for $1 seconds +Sleep for $1 seconds. =cut @@ -2512,7 +2523,7 @@ =item B<setline>(in INT) -Set the current line number we're executing code for +Set the current line number we're executing code for. =cut @@ -2523,7 +2534,7 @@ =item B<getline>(out INT) -Get the current line number +Get the current line number. =cut @@ -2534,7 +2545,7 @@ =item B<setfile>(in STR) -Sets the current file we're executing code for +Set the current file we're executing code for. =cut @@ -2545,7 +2556,7 @@ =item B<getfile>(out STR) -Gets the current file we're executing code for +Get the current file we're executing code for. =cut @@ -2556,7 +2567,7 @@ =item B<setpackage>(in STR) -Sets the current package we're executing code for +Set the current package we're executing code for. =cut @@ -2567,7 +2578,7 @@ =item B<getpackage>(out STR) -Gets the current package we're executing code for +Get the current package we're executing code for. =cut