Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
show how to query symbols exported by a module
  • Loading branch information
gfldex committed Jul 11, 2016
1 parent 3df7839 commit bb78130
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/Language/modules.pod6
Expand Up @@ -302,6 +302,21 @@ L<Cool>s.
say 0?, 1?, {}?, { a => "b" }?; # False True False True
=end code
=head2 Introspection
To list exported symbols of a module first query the export tags supported by
the module.
use URI::Escape;$
dd URI::Escape::EXPORT::.keys;$
# OUTPUT«("DEFAULT", "ALL").Seq»
Then use the tag you like and pick the symbol by it's name.
dd URI::Escape::EXPORT::DEFAULT::.keys;
# OUTPUT«("\&uri-escape", "\&uri_escape", "\&uri-unescape", "\&uri_unescape").Seq»
my &escape-uri = URI::Escape::EXPORT::DEFAULT::<&uri_escape>;
=head2 Finding Modules
A user may have a collection of modules not found in the normal
Expand Down

0 comments on commit bb78130

Please sign in to comment.