Permalink
Browse files

simplify the package tree walker a bit more

- use the % sigil for the Stash object
- map to $name instead of assigning inside the loop
- add missing semicolon
  • Loading branch information...
1 parent c36ca64 commit 68a91ab60f3dfb7ec7972621cb0e9b5cc2f31937 @masak committed Jun 14, 2016
Showing with 3 additions and 4 deletions.
  1. +3 −4 t/integration/val-q-classes.t
@@ -2,15 +2,14 @@ use v6;
use Test;
use _007;
-sub tree-walk(Stash $package, @accum) {
- for $package.keys -> $key {
- my $name = "{$package}::{$key}";
+sub tree-walk(%package, @accum) {
+ for %package.keys.map({ %package ~ "::$_" }) -> $name {
# make a little exception for Val::Sub::Builtin, which is just an
# implementation detail and doesn't have a corresponding builtin
# (because it tries to pass itself off as a Val::Sub)
next if $name eq "Val::Sub::Builtin";
push @accum, $name;
- tree-walk(::($name).WHO , @accum)
+ tree-walk(::($name).WHO , @accum);
}
}

1 comment on commit 68a91ab

@BenGoldberg1

You can get rid of "use MONKEY-SEE-NO-EVAL" now, I think.

Please sign in to comment.