Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created January 12, 2016 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/fa955e2ff7142d05b08f to your computer and use it in GitHub Desktop.
Save zoffixznet/fa955e2ff7142d05b08f to your computer and use it in GitHub Desktop.
sub descendants ($name, $prefix = '', $ns = ::GLOBAL.WHO) is export {
my @descendants;
for $ns.keys {
my $key = $prefix ~ $_;
say "\$key is $key";
my $type = 'Array';
try @descendants.append: ::($key).^parents;
@descendants.append: descendants $name, $key ~ '::', $ns{$_}
if $ns{$_}.keys;
}
return @descendants.unique;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment