Skip to content

Commit 2640d9e

Browse files
committed
state scoping rules for Sub
1 parent 3d1db3a commit 2640d9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/Type/Sub.pod6

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ coercers. To call them use the C<&>-sigil.
3636
say [Int, Int('42'),&Int('42')];
3737
# OUTPUT«[(Int) 42 oi‽]␤»
3838
39+
Subs can be nested and scoped with C<my> and C<our>, whereby C<my> is the
40+
default. A sub declared with C<my> can not be reached from any outer scope. An
41+
C<our> scoped sub will not redefine a sub of the same name in the outer scope.
42+
Any sub can be accessed via a closure from any outer scope.
43+
3944
=head1 Traits
4045
X<|trait_mod (declarator)>
4146

0 commit comments

Comments
 (0)