Created
May 1, 2017 20:44
-
-
Save zoffixznet/93493f687dbfdb7864813b120d2e5c77 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 sub infix:<cmp>(NumericStr:D $a, NumericStr:D $b) is default { | |
+ $a.Numeric cmp $b.Numeric || $a.Str cmp $b.Str | |
+} | |
+multi sub infix:<eqv>(NumericStr:D $a, NumericStr:D $b) is default { | |
+ $a.Numeric eqv $b.Numeric || $a.Str eqv $b.Str | |
+} | |
proto sub infix:<but>(|) is pure { * } | |
multi sub infix:<but>(Mu:D \obj, Mu:U \rolish) { | |
cpan@perlbuild3~/CPANPRC/rakudo (nom)$ ./perl6 -e 'dd <1.0> cmp <1.0>' | |
Ambiguous call to 'infix:<cmp>'; these signatures all match: | |
:(Str:D \a, Str:D \b --> Order:D) | |
:(Rational:D \a, Rational:D \b) | |
:(NumericStr:D $a, NumericStr:D $b) | |
in block <unit> at -e line 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment