Skip to content

Commit 410a848

Browse files
committed
classes are packages (kind of)
1 parent 38a6482 commit 410a848

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Language/typesystem.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ methods from foreign objects.
162162
say A.new.WHAT; # OUTPUT«(A)␤»
163163
say A.new."WHAT"() # OUTPUT«ain't gonna happen␤»
164164
165+
=head4 Methods in package scope
166+
167+
Any C<our> scoped method will be visible in the package scope of a class.
168+
169+
class C {
170+
our method packaged {};
171+
method loose {}
172+
};
173+
dd C::.keys
174+
# OUTPUT«("\&packaged",).Seq␤»
175+
165176
=head4 Setting Attributes with Namesake Variables and Methods
166177
167178
Instead of writing C<< attr => $attr >> or C<:attr($attr)>, you can save some

0 commit comments

Comments
 (0)