Skip to content

Commit bb78130

Browse files
committed
show how to query symbols exported by a module
1 parent 3df7839 commit bb78130

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/Language/modules.pod6

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,21 @@ L<Cool>s.
302302
say 0?, 1?, {}?, { a => "b" }?; # False True False True
303303
=end code
304304
305+
=head2 Introspection
306+
307+
To list exported symbols of a module first query the export tags supported by
308+
the module.
309+
310+
use URI::Escape;$
311+
dd URI::Escape::EXPORT::.keys;$
312+
# OUTPUT«("DEFAULT", "ALL").Seq»
313+
314+
Then use the tag you like and pick the symbol by it's name.
315+
316+
dd URI::Escape::EXPORT::DEFAULT::.keys;
317+
# OUTPUT«("\&uri-escape", "\&uri_escape", "\&uri-unescape", "\&uri_unescape").Seq»
318+
my &escape-uri = URI::Escape::EXPORT::DEFAULT::<&uri_escape>;
319+
305320
=head2 Finding Modules
306321
307322
A user may have a collection of modules not found in the normal

0 commit comments

Comments
 (0)