Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit module TestImports;
- sub bar is export { say "bar sub" }
- sub baz is export { say "baz sub" }
- my $var = 'He heu hey';
- my $aar = 'He heu hey';
- my $vaa = 'He heu hey';
- my $kar = 'He heu hey';
- my $vor = 'He heu hey';
- constant A = 333;
- constant APPART is export(:AP) = 174;
- constant COLOR_A = 24;
- constant COLOR_B = 84;
- constant COLOR_C = 88;
- constant COLOR_D = 92;
- constant COLOR_E is export(:SPECIAL)= 144;
- constant COLOR_F = 98;
- constant COLOR_G = 118;
- constant COLOR_H = 214;
- constant COLOR_I = 800;
- my package EXPORT::MYTAG {
- #filter the colors;
- my %c = TestImports::.grep(*.key.match(/^ ( COLOR_ <[A..Z]>+ ) $ /));
- #filter allready in TAG exported : so we exclude those that we do not want.
- my %e = EXPORT::.grep( *.key.grep( none /^ : ( ALL || DEFAULT || MYTAG ) $ /));
- #This nearly works but will fail for :SPECIAL Tag because it's yet exported :(
- for %c {
- next if .key eq 'EXPORT';
- .key.say;
- OUR::{.key} := .value;
- }
- #NOTE: So we must exclude, :SPECIAL (and ev. others) building a loop with e.
- #IF i did well red the doc ALL SPECIAL should be in GLOBAL::EXPORT::SPECIAL::%(kv);
- #and
- ::GLOBAL::EXPORT::SPECIAL::.raku.say => WORKS; ==> (COLOR_E(80)) SO:
- for %e.kv -> $k,$v {
- #HERE IS THE QUESTION!!!!!!
- ::GLOBAL::EXPORT::($k)::.raku.say; #SHOULD WORK but does not: WHY.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement