Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fill in "arguments" section, and link to Capture
  • Loading branch information
skids committed Jan 26, 2015
1 parent f75b7a3 commit 3d7e48a
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions lib/Language/functions.pod
Expand Up @@ -96,9 +96,29 @@ L<documentation on the C<Signature> class|Signature>.
=head2 Arguments
TODO
=comment prefix:<|>, pair-chaining, \()
When calling a function, positional arguments should be supplied
in the same order as the function's signature. Named arguments
may be supplied in any order, but it is considered good form to
place named arguments after positional arguments. Inside the
argument list of a function call, some special syntax is supported:
f :named(35) # A named argument (in "adverb" form.)
f named => 35 # Also a named argument.
f :35named # A named argument using abbreviated adverb form
f 'named' => 35 # Not a named argument, a Pair in a positional argument
f |$c # Merge the contents of Capture $c as if they were supplied
Arguments passed to a function are conceptually first collected in a
C<Capture> container. Details about the syntax and use of these
containers can be found in the L<documentation on the C<Capture> class|Capture>.
When using named arguments, note that normal List "pair-chaining" allows
one to skip commas between named arguments.
f :dest</tmp/foo> :src</tmp/bar> :lines(512)
f :32x :50y :110z # This flavor of "adverb" works, too
f :a:b:c # The spaces are also optional.
=head2 Multi-dispatch
Perl 6 allows you to write several routines with the same name, but different
Expand Down

0 comments on commit 3d7e48a

Please sign in to comment.