Created
March 1, 2012 16:52
-
-
Save TimToady/1951347 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sub amb($var,*@a) { | |
"[{ | |
@a.pick(*).map: {"||\{ $var = '$_' }"} | |
}]"; | |
} | |
'' ~~ m/ | |
:my ($a,$b,$c,$d); | |
<{ amb '$a', <the that a> }> | |
<{ amb '$b', <frog elephant thing> }> | |
<?{ substr($a,*-1,1) eq substr($b,0,1) }> | |
<{ amb '$c', <walked treaded grows> }> | |
<?{ substr($b,*-1,1) eq substr($c,0,1) }> | |
<{ amb '$d', <slowly quickly> }> | |
<?{ substr($c,*-1,1) eq substr($d,0,1) }> | |
{ say "$a $b $c $d" } | |
<!> | |
/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment