Skip to content

Commit 2f096dd

Browse files
authored
Merge pull request #2893 from chloekek/patch-1
Improve consistency and completeness of Packages document
2 parents 56ce35b + 8b5e218 commit 2f096dd

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

CREDITS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ E: cmasak@gmail.com
7373
N: Carlin
7474
E: carbin@users.noreply.github.com
7575

76+
N: Chloé Kekoa
77+
E: rightfold+ck@gmail.com
78+
W: foldr.nl
79+
U: chloekek
80+
7681
N: Christopher Bottoms
7782
E: molecules@users.noreply.github.com
7883

doc/Language/packages.pod6

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class Foo {
3333
}
3434
}
3535
36-
my $foo; # simple identifiers
37-
say Foo::Bar.baz; # Calling a method; OUTPUT: «Þor is mighty␤»
38-
say Foo::Bar::zape; # compound identifiers separated by ::; OUTPUT: «zipi␤»
36+
my $foo; # simple identifiers
37+
say Foo::Bar.baz; # calling a method; OUTPUT: «Þor is mighty␤»
38+
say Foo::Bar::zape; # compound identifiers separated by ::; OUTPUT: «zipi␤»
3939
my $bar = 'Bar';
40-
say $Foo::($bar)::quux;# compound identifiers with interpolations; OUTPUT: «42␤»
41-
$42; # numeric names
42-
$!; # certain punctuation variables
40+
say $Foo::($bar)::quux; # compound identifiers with interpolations; OUTPUT: «42␤»
41+
$42; # numeric names
42+
$!; # certain punctuation variables
4343
=end code
4444
4545
X<|::,package>
@@ -53,7 +53,7 @@ exists.
5353
=begin code
5454
package Foo:ver<0> {};
5555
module Foo:ver<1> {};
56-
say Foo.^ver; OUTPUT: «1␤»
56+
say Foo.^ver; # OUTPUT: «1␤»
5757
=end code
5858
5959
The syntax allows the declared package to use a version, but as a matter of
@@ -169,10 +169,10 @@ searched last.
169169
Use the C<MY> pseudopackage to limit the lookup to the current lexical scope,
170170
and C<OUR> to limit the scopes to the current package scope.
171171
172-
In the same vein, class and method names can be interpolated too.
172+
In the same vein, class and method names can be interpolated too:
173173
174174
role with-method {
175-
method a-method { return "in-a-method of " ~ $?CLASS.^name };
175+
method a-method { return 'in-a-method of ' ~ $?CLASS.^name };
176176
}
177177
178178
class a-class does with-method {
@@ -181,16 +181,16 @@ In the same vein, class and method names can be interpolated too.
181181
182182
class b-class does with-method {};
183183
184-
my $what-class='a-class';
184+
my $what-class = 'a-class';
185185
186-
say ::($what-class).a-method;
186+
say ::($what-class).a-method; # OUTPUT: «in-a-method of a-class␤»
187187
$what-class = 'b-class';
188-
say ::($what-class).a-method;
188+
say ::($what-class).a-method; # OUTPUT: «in-a-method of b-class␤»
189189
190-
my $what-method='a-method';
191-
say a-class."$what-method"();
192-
$what-method='another-method';
193-
say a-class."$what-method"();
190+
my $what-method = 'a-method';
191+
say a-class."$what-method"(); # OUTPUT: «in-a-method of a-class␤»
192+
$what-method = 'another-method';
193+
say a-class."$what-method"(); # OUTPUT: «in-another-method␤»
194194
195195
X<|::($c).m>
196196
X<|A."$m"()>
@@ -203,7 +203,7 @@ package name as a hash:
203203
204204
=for code :skip-test<showcasing syntaxes>
205205
Foo::Bar::{'&baz'} # same as &Foo::Bar::baz
206-
PROCESS::<$IN> # Same as $*IN
206+
PROCESS::<$IN> # same as $*IN
207207
Foo::<::Bar><::Baz> # same as Foo::Bar::Baz
208208
209209
Unlike C<::()> symbolic references, this does not parse the argument for

0 commit comments

Comments
 (0)