-
-
Save 2colours/0720e806de9107437a5ab8b53fdaa2b7 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
my @hexa-letters <== sort() <== |('a'..'f'), |<o l i s t>; | |
proto next-hexa-word($current-word) {*} # if I don't add this: `Cannot resolve caller next-hexa-word(aa, ab); none of these signatures matches (...)` | |
multi next-hexa-word('' --> 'a') {} | |
multi next-hexa-word($current-word where /t$/) { samewith($current-word.chop: 1) ~ 'a' } | |
multi next-hexa-word($current-word where /(.)$/) { $current-word.chop(1) ~ @hexa-letters.first: * gt $0 } | |
my @hexa-sequence = 'a' x 2, &next-hexa-word ... 't' x 4; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment