diff --git a/doc/Type/Parameter.pod6 b/doc/Type/Parameter.pod6 index ca80b9135..fad5b0b5a 100644 --- a/doc/Type/Parameter.pod6 +++ b/doc/Type/Parameter.pod6 @@ -44,28 +44,29 @@ if the parameter is anonymous. This "sigil" is actually an introspection used to help determine the normal binding style of a parameter, if it has not been altered -through a L. +through a L. =begin table - Will bind to Default behavior - = ====================== ================================================================ - C<$> Scalar Generate new Scalar, use instead of Scalar in argument, if any - C<@> Positional Bind directly to the argument - C<@> PositionalBindFailover If binding failed, call argument's .cache method, bind to result - C<%> Associative Bind directly to the argument - C<&> Callable Bind directly to the argument - C<|> (anything) Bind to all remaining arguments, make new Capture if needed - C<\> (anything) Bind directly to the argument, keep existing Scalar, if any +Sigil | Will bind to | Default behavior +=================================================== + $ | Scalar | Generate new Scalar, use instead of Scalar in argument, if any + @ | Positional | Bind directly to the argument + @ | PositionalBindFailover | If binding failed, call argument's .cache method, bind to result + % | Associative | Bind directly to the argument + & | Callable | Bind directly to the argument + \ | (anything) | Bind directly to the argument, keep existing Scalar, if any =end table +Also, C<|> will bind to all remaining arguments, make new C if needed. + =head2 method type -Returns the L of +Returns the L of the parameter. =head2 method constraints -Returns L on the +Returns L on the parameter (usually as an C-Junction). =head2 method named @@ -74,7 +75,7 @@ Defined as: method named(Parameter:D: --> Bool:D) -Returns C if it's a L. +Returns C if it's a L. my Signature $sig = :(Str $x, Bool :$is-named); say $sig.params[0].named; # OUTPUT: «False␤» @@ -87,7 +88,7 @@ Defined as: method named_names(Parameter:D: --> List:D) Returns the list of externally usable names/aliases for a -L. +L. =head2 method positional @@ -96,7 +97,7 @@ Defined as: method positional(Parameter:D: --> Bool:D) Returns C if the parameter is -L. +L. my Signature $sig = :(Str $x, Bool :$is-named); say $sig.params[0].positional; # OUTPUT: «True␤» @@ -109,7 +110,7 @@ Defined as: method slurpy(Parameter:D: --> Bool:D) Returns C for -L. +L. =head2 method twigil diff --git a/doc/Type/Signature.pod6 b/doc/Type/Signature.pod6 index f72b6713a..abea38bcc 100644 --- a/doc/Type/Signature.pod6 +++ b/doc/Type/Signature.pod6 @@ -20,7 +20,7 @@ X<|:()> Signatures appear inside parentheses after L and L names, on blocks after a C<< -> >> or C<< <-> >> arrow, as the input to L like +declarators|/language/variables#Variable_declarators_and_scope> like L|/syntax/my>, or as a separate term starting with a colon. sub f($x) { } @@ -138,7 +138,7 @@ check the signature of a L. $sig = :(Int, Positional); # just a type is also fine (two parameters) sub baz(Str) { "Got passed a Str" } -Type constraints may also be L. +Type constraints may also be L. X<|where clause> In addition to those I types, additional constraints can @@ -195,7 +195,7 @@ the C-clause inside the sub-signature. =head3 Constraining optional arguments -L can have constraints, +L can have constraints, too. Any C clause on any parameter will be executed, even if it's optional and not provided by the caller. In that case you may have to guard against undefined values within the C clause. @@ -204,7 +204,7 @@ against undefined values within the C clause. =head3 Constraining slurpy arguments -L can not have type +L can not have type constraints. A C-clause in conjunction with a L can be used to that effect. @@ -216,8 +216,8 @@ can be used to that effect. =head3 Constraining named arguments -Constraints against L apply to the value -part of the L. +Constraints against L apply to +the value part of the L. sub f(Int :$i){}; f :i; @@ -746,7 +746,7 @@ notionally) computed anew for each call =head2 Dynamic variables -L are allowed in signatures +L are allowed in signatures although they don't provide special behaviour because argument binding does connect two scopes anyway. @@ -815,7 +815,7 @@ arguments. This is often used in C definitions (like C) to indicate that the routine's L definitions|multi> can have any L. See L for an +constraints|#Type_constraints>. See L for an example. If bound to a variable arguments can be forwarded as a whole using the slip