6
6
7
7
class Stash is Hash { }
8
8
9
- A C < Stash > is a hash that is used for symbol tables at the package scoped in
10
- Perl 6.
9
+ A C < Stash > is a hash that is used for symbol tables at the package scoping level
10
+ in Perl 6.
11
11
12
- To get a Stash, you can all the C < .WHO > pseudo method on a package (because it
12
+ To get a Stash, you can call the C < .WHO > pseudo- method on a package (because it
13
13
answers the question I < who lives here? > ), or if you write the package name as
14
14
a literal, append two colons:
15
15
@@ -29,10 +29,12 @@ functionality:
29
29
say Boring::.keys.sort; # &package_sub Nested
30
30
say Boring::<Nested>; # (Nested)
31
31
32
- As the example above shows, lexicals and methods are not included in a Stash,
33
- since they do not live in the package table. (Methods have a separate method
34
- table, and are accessible through method calls or C < .can > and C < .^methods > ,
35
- and lexicals live in a separate lexical pad, which is only from inside the
36
- scope).
32
+ As the example above shows only "our"-scoped things appear in the C < Stash >
33
+ (nested classes are "our" by default, but can be excluded with "my".) Lexicals
34
+ and methods are not included in a Stash, since they do not live in the package
35
+ table. Lexicals live in a separate lexical pad, which is only visible from
36
+ inside the scope. Methods (in the case that the package is also a class) have
37
+ a separate method table, and are accessible through introspection on the
38
+ class itself, via C < .can > and C < .^methods > .
37
39
38
40
= end pod
0 commit comments