Created
March 21, 2017 21:40
-
-
Save gfldex/615a2926fe92c447a3eef5e3ba089a18 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
class IO::RecursivePath is IO::Path { | |
multi method dir(|rest) { | |
# callsame().map({ | |
# my $recurse = (); | |
# $recurse = dir(.Str, :recursive) if .d; | |
# |($recurse.Slip, .IO) | |
# }); | |
gather for callsame() { | |
take dir(.Str, :recursive) if .d; | |
take .IO; | |
} | |
} | |
} | |
sub dir($path = '.', :$recursive) { | |
IO::RecursivePath.new($path.Str).dir; | |
} | |
.Str.say for dir(:recursive); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment