Skip to content

Commit

Permalink
Tweak sub declarator example, address sink context warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfa committed Mar 23, 2018
1 parent 03a749d commit 3d00917
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Language/functions.pod6
Expand Up @@ -33,13 +33,13 @@ The sub declarator returns a value of type L<Sub|/type/Sub> that can be stored
in any container:
my &c = sub { say "Look ma, no name!" }
c;
c; # OUTPUT: «Look ma, no name!␤»
my Any:D $f = sub { say '$f' }
$f;
my Any:D $f = sub { say 'Still nameless...' }
$f(); # OUTPUT: «Still nameless...␤»
my Code \a = sub { say ‚raw containers don't implement postcircumfix:<( )>‘ };
a.();
a.(); # OUTPUT: «raw containers don't implement postcircumfix:<( )>␤»
The declarator C<sub> will declare a new name in the current scope at compile
time. As such any indirection has to be resolved at compile time:
Expand Down

0 comments on commit 3d00917

Please sign in to comment.