Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More fixing of links. Try to get this table pod thing to DWIM.
Also, avoid using the phrase "object of type Capture" in subject matter
so close to en-passant "type capture"s.
  • Loading branch information
skids committed Sep 14, 2015
1 parent d72d26c commit 958c399
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
33 changes: 17 additions & 16 deletions lib/Type/Parameter.pod
Expand Up @@ -40,33 +40,33 @@ 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<trait|/type/Signature#Parameter Traits and Modifiers>.
through a L<trait|/type/Signature#Parameter_Traits_and_Modifiers>.
=begin table
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 to all remaining arguments, make new Capture if needed
\ (anything) Bind directly to the argument, keep existing Scalar, if any
= ====================== ================================================================
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
=end table
=head2 method type
Returns the L<nominal type constraint|/type/Signature#Type Constraints> of
Returns the L<nominal type constraint|/type/Signature#Type_Constraints> of
the parameter.
=head2 method constraints
Returns L<additional constraints|/type/Signature#Type Constraints> on the
Returns L<additional constraints|/type/Signature#Type_Constraints> on the
parameter (usually as an C<all>-Junction).
=head2 method named
Returns C<True> if it's a L<named parameter|/type/Signature#Positional vs. Named>.
Returns C<True> if it's a L<named parameter|/type/Signature#Positional_vs._Named>.
=head2 method named_names
Expand Down Expand Up @@ -105,7 +105,7 @@ Returns C<True> for raw parameters.
Raw parameters bind either a variable or a value passed to it, with
no decontainerization taking place. That means that if a variable was passed
to it, you can assign to the parameter. This is different from
L<rw|#rw>-parameter which can only bind to variables, never to values.
L<rw|#method_rw>-parameter which can only bind to variables, never to values.
This is the normal behavior for parameters declared with a
L<sigil|#method sigil> of C<'\'>, which is not really a sigil insofar
Expand All @@ -121,7 +121,7 @@ their sigil in code.
=head2 method capture
Returns C<True> for parameters that capture the rest of the argument list into
a single object of L<type Capture|/type/Capture>.
a single L<Capture|/type/Capture> object.
sub how_many_extra_positionals($!, |capture) { capture.elems.say }
how_many_extra_positionals(0,1,2,3) #-> 3
Expand Down Expand Up @@ -177,7 +177,7 @@ in same the signature:
c("four",5,"six"); # Fails when binding $y, wants Str, not Int
Type captures may be used at the same time as
C<type costraints|/type/Signature#Type_Constraints>.
L<type costraints|/type/Signature#Type_Constraints>.
sub d(::T Numeric $x, T $y);
d(4,5); # OK
Expand All @@ -187,7 +187,8 @@ C<type costraints|/type/Signature#Type_Constraints>.
=head2 method sub_signature
If the parameter has a C<sub-signature|/type/Signature#Destructuring_Parameters>,
If the parameter has a
L<sub-signature|/type/Signature#Destructuring_Parameters>,
returns a Signature object for it. Otherwise returns C<Any>.
=end pod
10 changes: 5 additions & 5 deletions lib/Type/Signature.pod
Expand Up @@ -6,7 +6,7 @@
class Signature { ... }
A signature is a static description of the C<parameter|Parameter> list
A signature is a static description of the L<parameter|Parameter> list
of a code object. That is, it describes what and how many arguments
you need to pass to the code or function in order to call it.
Expand All @@ -17,7 +17,7 @@ a L<Capture>, to the signature.
Signatures appear in parenthesis after subroutine and method names, on
blocks after a C<< -> >> or C<< <-> >> arrow, as the input to
L<variable declarators|language/variables.html#Variable_Declarators_and_Scope>
L<variable declarators|/language/variables#Variable_Declarators_and_Scope>
like L<C<my>>, or as a separate term starting with a colon.
=begin code :allow<B L>
Expand Down Expand Up @@ -83,7 +83,7 @@ its type constraint.
:(B<L<Int>>, B<L<Positional>>) # just a type is also fine (two parameters)
sub baz (B<L<Str>>) { "Got passed a Str" }
Type constraints may also be C<type captures|#Signature/method type_captures>.
Type constraints may also be L<type captures|Signature/#method_type_captures>.
In addition to those I<nominal> types, additional constraints can
be placed on parameters in the form of code blocks which must return
Expand Down Expand Up @@ -196,7 +196,7 @@ intermediary Scalar it is bypassed during this process, and
is not available inside the called function.
Slurpy parameters have special behaviors when combined with some
L<traits and modifiers|#Parameter Traits and Modifiers>,
L<traits and modifiers|#Parameter_Traits_and_Modifiers>,
as described below.
=head2 Positional vs. Named
Expand Down Expand Up @@ -322,7 +322,7 @@ value of the variable at the caller side.
On slurpy parameters, C<is rw> is reserved for future use by language
designers.
The L<C<is raw> trait|Parameter#method raw> is automatically applied to
The L<C<is raw> trait|/type/Parameter#method_raw> is automatically applied to
parameters declared with a backslash as a "sigil", and may also be used
to make normally sigiled parameters behave like these do. In the special
case of slurpies, which normally produce an C<Array> full of C<Scalar>s
Expand Down

0 comments on commit 958c399

Please sign in to comment.