Created
October 9, 2021 15:39
-
-
Save gfldex/ce1cc2fa77e6b1c7f4dc21d4974ee5fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6.d; | |
use Transport {'WWW', :prefix<www->}; | |
say www-get('http://www.heise.de/index.html'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6.d; | |
sub EXPORT(&args) { | |
my ($module-name, *%tags) = args; | |
my \module = (require ::($module-name)); | |
my %exports = module.WHO<EXPORT>.WHO<DEFAULT>.WHO.&{.keys Z=> .values}; | |
my %prefixed-exports = %exports.map: { .key.substr(0, 1) ~ %tags<prefix> ~ .key.substr(1..*) => .value }; | |
%prefixed-exports.Map | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment