Skip to content

Commit 9e92433

Browse files
author
Jan-Olof Hendig
committed
Added a few more method definitions and an example
1 parent 03a21f8 commit 9e92433

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/Type/Parameter.pod6

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ If the parameter is anonymous, C<Nil> will be returned.
3333
3434
=head2 method sigil
3535
36+
Defined as:
37+
38+
method sigil(Parameter:D:) returns Str:D
39+
3640
Returns a string containing the parameter's sigil, for a looser
3741
definition of "sigil" than what is considered part of
3842
the variable's C<name|method name>. Still returns a sigil even
@@ -72,8 +76,16 @@ Defined as:
7276
7377
Returns C<True> if it's a L<named parameter|/type/Signature#Positional_vs._Named>.
7478
79+
my Signature $sig = :(Str $x, Bool :$is-named);
80+
say $sig.params[0].named; # False
81+
say $sig.params[1].named; # True
82+
7583
=head2 method named_names
7684
85+
Defined as:
86+
87+
method named_names(Parameter:D:) returns List:D
88+
7789
Returns the list of externally usable names/aliases for a
7890
L<named parameter|/type/Signature#Positional_vs._Named>.
7991
@@ -204,6 +216,10 @@ this parameter, or C<Any> if no default was provided.
204216
205217
=head2 method type_captures
206218
219+
Defined as:
220+
221+
method type_captures(Parameter:D:) returns List:D
222+
207223
Returns a list of variable names of type captures associated with this
208224
parameter. Type captures define a type name within the attached code,
209225
which is an alias to the type gleaned from the argument during a call.

0 commit comments

Comments
 (0)