Skip to content

Commit

Permalink
Merge pull request #2851 from uzluisf/master
Browse files Browse the repository at this point in the history
Add minor rewording
  • Loading branch information
JJ committed Jun 13, 2019
2 parents afe831b + c193bad commit a98de47
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions doc/Language/modules.pod6
Expand Up @@ -39,7 +39,7 @@ instance. Then,
zef install WWW
will install the module with that particular name, if it is not already
installed. N<If it's installed it will reinstall only if the version of
installed. N<If it's installed, it will reinstall only if the version of
the module is newer than the one installed>
Expand Down Expand Up @@ -83,9 +83,9 @@ class Class {}
=end code
C<MyModule::Class> will be defined when C<MyModule> is loaded, and you can use
it directly employing its fully qualified name. Classes and other types defined
that way are not automatically exported; you will need to explicitly export it
if you want to use it by its short name:
it directly employing its fully qualified name (FQN). Classes and other types
defined that way are not automatically exported; you will need to explicitly
export it if you want to use it by its short name:
=begin code :solo
# MyModule.pm6
Expand Down Expand Up @@ -192,9 +192,10 @@ a C<Failure>. The correct way is:
=head2 Lexical module loading
Perl 6 takes great care to avoid global state, i.e. whatever you do in
your module, it should not affect other code. That's why e.g. subroutine
definitions are lexically (C<my>) scoped by default. If you want others
to see them, you need to explicitly make them our scoped or export them.
your module, it should not affect other code. For instance, that's why
subroutine definitions are lexically (C<my>) scoped by default. If you want
others to see them, you need to explicitly make them C«our» scoped or export
them.
Classes are exported by default on the assumption that loading a module will not
be of much use when you cannot access the classes it contains. Loaded classes
Expand Down Expand Up @@ -243,7 +244,7 @@ authors and versions).
class MyModule::MyClass {};
=end code
As with all traits, if applied to a routine, "is export" should appear after
As with all traits, if applied to a routine, C«is export» should appear after
any argument list.
=begin code :solo
Expand Down Expand Up @@ -281,7 +282,7 @@ not an easy task at the moment (see
L<RT #127305|https://rt.perl.org/Public/Bug/Display.html?id=127305>).
One way
the author can provide such access is to give each C<export> trait its
own unique tag. (And the tag can be the object name!) Then the user can
own unique tag. (And the tag can be the object name!). Then the user can
either (1) import all objects:
=begin code :skip-test<needs dummy module>
Expand Down Expand Up @@ -347,7 +348,7 @@ Is the same as:
}
=end code
For most purposes C<is export> is sufficient but the C<EXPORT>
For most purposes, C<is export> is sufficient but the C<EXPORT>
packages are useful when you want to produce the exported symbols
dynamically. For example:
Expand Down Expand Up @@ -412,8 +413,8 @@ it is part of the compunit rather than the package.
Whereas C<UNIT::EXPORT> packages deal with the named parameters passed
to C<use>, the C<EXPORT> sub handles positional parameters. If you
pass positional parameters to C<use> they will be passed to
C<EXPORT>. If a positional is passed the module no longer exports
pass positional parameters to C<use>, they will be passed to
C<EXPORT>. If a positional is passed, the module no longer exports
default symbols. You may still import them explicitly by
passing C<:DEFAULT> to C<use> along with your positional parameters.
Expand Down

0 comments on commit a98de47

Please sign in to comment.