Created
September 26, 2016 01:01
-
-
Save zoffixznet/baadcb4ac4c2b2543a1377714b019c3f 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
proto sub infix:<KK>(|) { * } | |
multi sub infix:<KK>(Mu $x = Bool::False) { $x } | |
multi sub infix:<KK>(Mu \a, &b) { a ^^ b() } | |
multi sub infix:<KK>(Mu \a, Mu \b) { a ^^ b } | |
multi sub infix:<KK>(+@a) { | |
my Mu $a = shift @a; | |
while @a { | |
my Mu $b := shift @a; | |
$b := $b() if $b ~~ Callable; | |
next unless $b; | |
return Nil if $a; | |
$a := $b; | |
} | |
$a; | |
} | |
say Any KK sub {42} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment