Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Copy over the documentation of the radix op from nqp.ops.
  • Loading branch information
pmurias committed Sep 16, 2013
1 parent 289685c commit f0716d4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/ops.markdown
@@ -1,11 +1,11 @@
# savecapture
# savecapture()

Gets hold of the argument capture passed to the current block.e
Commits to doing enough copying that the list is valid any amount of time.
See usecapture for a version of the op that doesn't promise that.
Used by the multi-dispatcher.

# usecapture
# usecapture()

Gets hold of the argument capture passed to the current block.
(a future usecapture may invalidate it)
Expand All @@ -16,3 +16,19 @@ Used by the multi-dispatcher.

Returns a hash containing the environment variables.
Changing the hash doesn't affect the environment variables

# radix($radix, $str, $pos, $flags)

Convert string $str into a number starting at offset $pos and using radix $radix.
The result of the conversion returns an array with
out[0] = converted value
out[1] = radix ** (number of digits converted)
out[2] = offset after consuming digits, -1 if no digits consumed
The opcode skips single underscores between pairs of digits, per the Perl 6
specification.

The $flags is a bitmask that modifies the parse and/or result:
0x01: negate the result (useful if you've already parsed a minus)
0x02: parse a leading +/- and negate the result on -
0x04: parse trailing zeroes but do not include in result
(for parsing values after a decimal point)

0 comments on commit f0716d4

Please sign in to comment.