Skip to content

Instantly share code, notes, and snippets.

Created March 24, 2015 16:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/48efcb021cc1dd55fdd2 to your computer and use it in GitHub Desktop.
Save anonymous/48efcb021cc1dd55fdd2 to your computer and use it in GitHub Desktop.
{
multi sub infix:<cmp>(42, "Life, The Universe, and Everything") { Order::Same }
{{{{{
sub trylift () {
nonlifter;
lifter;
}
trylift;
}}}}}
}
sub nonlifter () {
say "Normal: { 42 cmp "Life, The Universe, and Everything" }";
}
sub lifter () {
my &infix:<cmp> = CALLER::LEXICAL::{ '&infix:<cmp>' };
say "Lifted: { 42 cmp "Life, The Universe, and Everything" }";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment