Browse files

Point out `sub EXPORT` must be before `unit`

  • Loading branch information...
zoffixznet committed May 23, 2018
1 parent 9e948d0 commit 792e1facdc2785ca1bac6180aef03a5d543513e4
Showing with 12 additions and 0 deletions.
  1. +12 −0 doc/Language/modules.pod6
@@ -410,6 +410,18 @@ Then use the tag you like and pick the symbol by its name.
# OUTPUT: «(&uri-escape &uri-unescape &uri_escape &uri_unescape)␤»
my &escape-uri = URI::Escape::EXPORT::DEFAULT::<&uri_escape>;
Be careful I<not> to put C<sub EXPORT> after L«C<unit> declarator|/syntax/unit».
If you do so, it'll become just a sub inside your package, rather than the special
export sub:
unit module Bar;
sub EXPORT { %(Foo => &say) } # WRONG!!! Sub is scoped wrong
# ---------
sub EXPORT { %(Foo => &say) } # RIGHT!!! Sub is outside the module
unit module Bar;
=head2 Finding Modules
It is up to the module installer to know where C<compunit> expects modules to

0 comments on commit 792e1fa

Please sign in to comment.