Skip to content

Commit

Permalink
Changed incorrect opcode in example, Removed duplicate section.
Browse files Browse the repository at this point in the history
Courtesy aninhumer++



git-svn-id: https://svn.parrot.org/parrot/trunk@43426 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
coke committed Jan 12, 2010
1 parent 96d8c5c commit 8719fc7
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions docs/pmc/subs.pod
Expand Up @@ -215,33 +215,6 @@ To receive multiple values, put the register names in parentheses:

=end PIR_FRAGMENT

To test whether a value was returned, declare it C<:optional>, and follow it
with an integer register declared C<:opt_val>:

=begin PIR_FRAGMENT_INVALID

($P10 :optional, $I10 :opt_val) = do_something($P1, $S3)

=end PIR_FRAGMENT_INVALID

Both of these affect only the signature provided via C<get_results>.

[should also describe :flat, :slurpy, :named, ..., or at least provide a
reference. -- rgr, 25-May-08.]

=begin PIR_FRAGMENT

# Call the sub in $P8, with continuation (created earlier) in $P9.
invoke $P8, $P9

=end PIR_FRAGMENT

=head2 Returning from a sub

PIR supports a convenient syntax for returning any number of values from a sub
or closure:


To test whether a value was returned, declare it C<:optional>, and follow it
with an integer register declared C<:opt_val>:

Expand Down Expand Up @@ -281,7 +254,7 @@ to:

=begin PIR_FRAGMENT

get_results '(0,0,0)', $P0, $I1, $S3
set_returns '(0,0,0)', $P0, $I1, $S3
returncc # return by calling the current continuation

=end PIR_FRAGMENT
Expand Down

0 comments on commit 8719fc7

Please sign in to comment.