@@ -18,6 +18,8 @@ implemented using L<roles|Role> with L<stubbed|Stub> methods.
18
18
method bark { say "woof" } # *MUST* be implemented by class
19
19
}
20
20
21
+ = head1 Actions
22
+
21
23
= head1 Advent Calendar
22
24
23
25
In the context of Perl 6, a yearly set of blog posts for each day from
@@ -48,6 +50,21 @@ followed by a name (for the key):
48
50
49
51
Also see L < Colon Pair and Colon List > .
50
52
53
+ = head1 Adverbial Pair
54
+
55
+ A generalized form of L < /pair notation > . They all start with the colon, like:
56
+
57
+ adverbial pair | pair notation
58
+ ================|==============
59
+ :foo<bar> | foo => 'bar'
60
+ :foo(42) | foo => 42
61
+ :42foo | foo => 42
62
+ :$foo | foo => $foo
63
+ :foo | foo => True
64
+ :!foo | foo => False
65
+
66
+ Also see L < /Adverb > and L < /Colon Pair and Colon List > .
67
+
51
68
= head1 Anonymous
52
69
53
70
A subroutine, method or submethod is called I < anonymous > if it can't be
@@ -59,7 +76,8 @@ called by name.
59
76
# anonymous subroutine, stored in a named scalar
60
77
my $double = sub ($x) { 2 * $x };
61
78
62
- Note that it is still allowed to have a name
79
+ Note that it is still allowed to have a name, but you cannot call it by
80
+ that name:
63
81
64
82
# anonymous, but knows its own name
65
83
my $s = anon sub triple($x) { 3 * $x }
@@ -91,6 +109,26 @@ initial barrage of RFC's that came out of the Perl community. Now only kept
91
109
as an historical document for reference. See also L < Exegesis > and
92
110
L < Synopsis > .
93
111
112
+ = head1 Argument
113
+
114
+ A value that you pass on to a L < subroutine|Subroutine > , L < method|Method >
115
+ or a L < callable block|Callable > . As opposed to the L < Parameter > that is
116
+ specified in the definition of a subroutine/method/callable block.
117
+
118
+ sub foo($bar) { say $bar } # $bar is a parameter
119
+ foo(42); # 42 is an argument
120
+
121
+ = head1 Array
122
+
123
+ L < Array|/type/Array > is a subclass of L < List|/type/List > that is mutable.
124
+ This means you can e.g. C < .push > and C < .pop > on an array, whereas you cannot
125
+ do that on a list. This is separate from the type of elements in the array:
126
+ if they are containers, then they are also mutable, but they don't have to
127
+ be. Arrays are typically recognizable by the L < @ > L < sigil|Sigil > .
128
+
129
+ my @array = 1,2,3;
130
+ say @a; # [1 2 3]
131
+
94
132
= head1 Arity
95
133
96
134
The number of L < positional|Positional > operands expected by an
@@ -485,6 +523,8 @@ Examples of things that are not lvalues:
485
523
sub f { }; f(); # "normal" subs are not writable
486
524
sub f($x) { $x = 3 }; # error - parameters are read-only by default
487
525
526
+ These are typically called L < rvalues|rvalue > .
527
+
488
528
= head1 Mainline
489
529
490
530
The C < mainline > is the program text that is not part of any kind of block.
@@ -504,6 +544,16 @@ pre-compiled file).
504
544
505
545
See L < Attribute > .
506
546
547
+ = head1 Parameter
548
+
549
+ L < Parameter|/type/Parameter > is a class to define parameters to
550
+ L < subroutines|Subroutine > , L < methods|Method > and a L < callable blocks|Callable > .
551
+ As opposed to the L < arguments|Argument > you specify when calling a
552
+ subroutine/method/callable block.
553
+
554
+ sub foo($bar) { say $bar } # $bar is a parameter
555
+ foo(42); # 42 is an argument
556
+
507
557
= head1 Property
508
558
509
559
See L < Attribute > .
0 commit comments