Last active
August 4, 2016 13:33
-
-
Save smls/98e28d5c23783d9e1ad86f25b6bb1e15 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
multi conjunct ($, *[]) { '' } | |
multi conjunct ($, $word) { $word } | |
multi conjunct ($conj, *@words) { "{@words[0..*-2].join: ', '} $conj @words[*-1]" } | |
say conjunct "and"; | |
say conjunct "and", "one apple"; | |
say conjunct "and", "one apple", "two oranges"; | |
say conjunct "and", "one apple", "two oranges", "three pears"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment