Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
small touch ups and sentence rewrites on modules
  • Loading branch information
LLFourn committed Jul 27, 2015
1 parent 53189e2 commit 33b9276
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/Language/modules.pod
Expand Up @@ -16,8 +16,8 @@ L<roles|/language/objects#Roles>, L<grammars|Grammar>),
L<subroutines|/language/functions>, and sometimes
L<variables|/language/variables>. In Perl 6 I<module> can also refer
to a type of package declared with the C<module> keyword (see example
below) but here we mostly mean "module" as a set of useful source
files in a well defined namespace.
below) but here we mostly mean "module" as a set of source
files in a namespace.
=head2 Loading and Basic Importing
Expand All @@ -31,7 +31,7 @@ exported available in the current lexical scope.
# loads and imports default symbols at compile time
use MyModule;
# imports defualt symbols at compile time
# imports default symbols at compile time
import MyModule;
# loads module at runtime
Expand Down Expand Up @@ -88,9 +88,9 @@ tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
=head2 EXPORT
You can arbitrarily export symbols with an C<EXPORT> sub. C<EXPORT>
You can export arbitrary symbols with an C<EXPORT> sub. C<EXPORT>
must return a L<EnumMap>, where the keys are the symbol names and
the values are the symbol values. The names should include the sigil
the values are the desired values. The names should include the sigil
(if any) for the associated type.
=begin code
Expand Down Expand Up @@ -124,9 +124,10 @@ Note, C<EXPORT> can't be declared inside a package because
presently rakudo (2015.06) seems to treat C<EXPORT> as part of the
compunit rather than the package.
C<EXPORT> gets passed positional arguments passed to C<use>. However
if C<use> is passed an argument the module will no longer export
default items.
If you pass positional parameters to C<use> they will be passed to
C<EXPORT>. The module no longer exports default symbols if a
positional is passed, however you may still import them explicitly by
passing :C<DEFAULT> to C<use>.
=begin code
# lib/MyModule
Expand Down

0 comments on commit 33b9276

Please sign in to comment.