Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Corrections in Capture doc (#598)
* Change delimiters on formatted code

* Parenthesize single numeric value

example code generates warnings of potential difficulties

* Update Capture.pod
  • Loading branch information
parabolize authored and moritz committed Jun 15, 2016
1 parent 26365b9 commit 5fe50f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Type/Capture.pod
Expand Up @@ -15,9 +15,9 @@ When you call C<print $a, $b>, the C<$a, $b> part is a Capture.
Captures contain a list-like part for positional arguments and a hash-like
part for named arguments. For the named arguments, Captures use a slightly
different I<syntax> than a normal List. There are two easy ways to make a
named argument: 1) use an unquoted key naming a parameter, followed by C<'=>'>,
followed by the argument and 2) use a colon-pair literal named after the
parameter:
named argument: 1) use an unquoted key naming a parameter, followed by
C«=>», followed by the argument and 2) use a colon-pair literal named
after the parameter:
say unique 1, -2, 2, 3, as => { abs $_ }; # 1, -2, 3
# ... is the same thing as:
Expand All @@ -31,7 +31,7 @@ Commonly, this term will be a List of terms, from which any Pair
literal will be placed in the named part, and all other terms will be
placed in the positional part.
my $c = \42; # Capture with one positional parts
my $c = \(42); # Capture with one positional parts
$c = \(1, 2, a => 'b'); # Capture with two positional and one named part
To use such a Capture, you may use C<'|'> before it in a function call, and it
Expand Down

0 comments on commit 5fe50f7

Please sign in to comment.