Skip to content

Commit b203297

Browse files
committed
Fixing anchors, refs #2146 and #561
1 parent 3859d61 commit b203297

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

doc/Type/Parameter.pod6

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,29 @@ if the parameter is anonymous.
4444
4545
This "sigil" is actually an introspection used to help determine
4646
the normal binding style of a parameter, if it has not been altered
47-
through a L<trait|/type/Signature#Parameter_Traits_and_Modifiers>.
47+
through a L<trait|/type/Signature#Parameter_traits_and_modifiers>.
4848
4949
=begin table
50-
Will bind to Default behavior
51-
= ====================== ================================================================
52-
C<$> Scalar Generate new Scalar, use instead of Scalar in argument, if any
53-
C<@> Positional Bind directly to the argument
54-
C<@> PositionalBindFailover If binding failed, call argument's .cache method, bind to result
55-
C<%> Associative Bind directly to the argument
56-
C<&> Callable Bind directly to the argument
57-
C<|> (anything) Bind to all remaining arguments, make new Capture if needed
58-
C<\> (anything) Bind directly to the argument, keep existing Scalar, if any
50+
Sigil | Will bind to | Default behavior
51+
===================================================
52+
$ | Scalar | Generate new Scalar, use instead of Scalar in argument, if any
53+
@ | Positional | Bind directly to the argument
54+
@ | PositionalBindFailover | If binding failed, call argument's .cache method, bind to result
55+
% | Associative | Bind directly to the argument
56+
& | Callable | Bind directly to the argument
57+
\ | (anything) | Bind directly to the argument, keep existing Scalar, if any
5958
=end table
6059
60+
Also, C<|> will bind to all remaining arguments, make new C<Capture> if needed.
61+
6162
=head2 method type
6263
63-
Returns the L<nominal type constraint|/type/Signature#Type_Constraints> of
64+
Returns the L<nominal type constraint|/type/Signature#Type_constraints> of
6465
the parameter.
6566
6667
=head2 method constraints
6768
68-
Returns L<additional constraints|/type/Signature#Type_Constraints> on the
69+
Returns L<additional constraints|/type/Signature#Type_constraints> on the
6970
parameter (usually as an C<all>-Junction).
7071
7172
=head2 method named
@@ -74,7 +75,7 @@ Defined as:
7475
7576
method named(Parameter:D: --> Bool:D)
7677
77-
Returns C<True> if it's a L<named parameter|/type/Signature#Positional_vs._Named>.
78+
Returns C<True> if it's a L<named parameter|/type/Signature#Positional_vs._named_arguments>.
7879
7980
my Signature $sig = :(Str $x, Bool :$is-named);
8081
say $sig.params[0].named; # OUTPUT: «False␤»
@@ -87,7 +88,7 @@ Defined as:
8788
method named_names(Parameter:D: --> List:D)
8889
8990
Returns the list of externally usable names/aliases for a
90-
L<named parameter|/type/Signature#Positional_vs._Named>.
91+
L<named parameter|/type/Signature#Positional_vs._named_arguments>.
9192
9293
=head2 method positional
9394
@@ -96,7 +97,7 @@ Defined as:
9697
method positional(Parameter:D: --> Bool:D)
9798
9899
Returns C<True> if the parameter is
99-
L<positional|/type/Signature#Positional_vs._Named>.
100+
L<positional|/type/Signature#Positional_vs._named_arguments>.
100101
101102
my Signature $sig = :(Str $x, Bool :$is-named);
102103
say $sig.params[0].positional; # OUTPUT: «True␤»
@@ -109,7 +110,7 @@ Defined as:
109110
method slurpy(Parameter:D: --> Bool:D)
110111
111112
Returns C<True> for
112-
L<slurpy parameters|/type/Signature#Slurpy_(A.K.A._Variadic)_Parameters>.
113+
L<slurpy parameters|/type/Signature#Slurpy_(A.K.A._variadic)_parameters>.
113114
114115
=head2 method twigil
115116

doc/Type/Signature.pod6

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ X<|:()>
2020
Signatures appear inside parentheses after L<subroutine|/type/Sub> and
2121
L<method|/type/Method> names, on blocks after a C<< -> >> or C<< <-> >> arrow,
2222
as the input to L<variable
23-
declarators|/language/variables#Variable_Declarators_and_Scope> like
23+
declarators|/language/variables#Variable_declarators_and_scope> like
2424
L<C<my>|/syntax/my>, or as a separate term starting with a colon.
2525
2626
sub f($x) { }
@@ -138,7 +138,7 @@ check the signature of a L<Callable>.
138138
$sig = :(Int, Positional); # just a type is also fine (two parameters)
139139
sub baz(Str) { "Got passed a Str" }
140140
141-
Type constraints may also be L<type captures|/type/Signature#Type_Captures>.
141+
Type constraints may also be L<type captures|/type/Signature#Type_captures>.
142142
143143
X<|where clause>
144144
In addition to those I<nominal> types, additional constraints can
@@ -195,7 +195,7 @@ the C<where>-clause inside the sub-signature.
195195
196196
=head3 Constraining optional arguments
197197
198-
L<Optional arguments|#Optional_and_Mandatory_Parameters> can have constraints,
198+
L<Optional arguments|#Optional_and_mandatory_arguments> can have constraints,
199199
too. Any C<where> clause on any parameter will be executed, even if it's
200200
optional and not provided by the caller. In that case you may have to guard
201201
against undefined values within the C<where> clause.
@@ -204,7 +204,7 @@ against undefined values within the C<where> clause.
204204
205205
=head3 Constraining slurpy arguments
206206
207-
L<Slurpy arguments|#Slurpy_(A.K.A._Variadic)_Parameters> can not have type
207+
L<Slurpy arguments|#Slurpy_(A.K.A._variadic)_parameters> can not have type
208208
constraints. A C<where>-clause in conjunction with a L<Junction|/type/Junction>
209209
can be used to that effect.
210210
@@ -216,8 +216,8 @@ can be used to that effect.
216216
217217
=head3 Constraining named arguments
218218
219-
Constraints against L<Named arguments|#Positional_vs._Named> apply to the value
220-
part of the L<colon-pair|/type/Pair>.
219+
Constraints against L<Named arguments|#Positional_vs._named_arguments> apply to
220+
the value part of the L<colon-pair|/type/Pair>.
221221
222222
sub f(Int :$i){};
223223
f :i<forty-two>;
@@ -746,7 +746,7 @@ notionally) computed anew for each call
746746
747747
=head2 Dynamic variables
748748
749-
L<Dynamic variables|/language/variables#The_*_Twigil> are allowed in signatures
749+
L<Dynamic variables|/language/variables#The_*_twigil> are allowed in signatures
750750
although they don't provide special behaviour because argument binding does
751751
connect two scopes anyway.
752752
@@ -815,7 +815,7 @@ arguments.
815815
816816
This is often used in C<proto> definitions (like C<proto foo (|) {*}>) to
817817
indicate that the routine's L<C<multi> definitions|multi> can have any L<type
818-
constraints|#Type_Constraints>. See L<proto|/language/functions#proto> for an
818+
constraints|#Type_constraints>. See L<proto|/language/functions#proto> for an
819819
example.
820820
821821
If bound to a variable arguments can be forwarded as a whole using the slip

0 commit comments

Comments
 (0)