Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #346 from gfldex/master
EXPORT can take arguments |  	fix link
  • Loading branch information
gfldex committed Jan 13, 2016
2 parents c4076e8 + 2e7d8de commit a7aa693
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions doc/Language/modules.pod
Expand Up @@ -283,6 +283,23 @@ passing C<:DEFAULT> to C<use> along with your positional parameters.
shy(); #FAIL - won't be imported
=end code
C<EXPORT> can take arguments, given it was provided with a signature. Type
captures are supported.
# lib/MyModule.pm
sub EXPORT(Int $i = 42) {
{
'foo' => sub () { $i }
}
}
# main.pl
use MyModule 666;
foo(); # 666
=head1 Distributing Modules
If you've written a Perl 6 module and would like to share it with the
Expand Down
2 changes: 1 addition & 1 deletion doc/Type/Mu.pod
Expand Up @@ -251,7 +251,7 @@ Marks a type as being exported, that is, available to external users.
A user of a module or class automatically gets all the symbols imported that
are marked as C<is export>.
See L</language/modules#Exporting and Selective Importing> for more details.
See L</language/modules#Exporting_and_Selective_Importing> for more details.
=head2 method take
Expand Down

0 comments on commit a7aa693

Please sign in to comment.