Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created September 26, 2016 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/baadcb4ac4c2b2543a1377714b019c3f to your computer and use it in GitHub Desktop.
Save zoffixznet/baadcb4ac4c2b2543a1377714b019c3f to your computer and use it in GitHub Desktop.
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