-
-
Save anonymous/07ae3cfeb8837ecfb424 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
diff --git a/src/builtins/cmp.pir b/src/builtins/cmp.pir | |
index a201aa3..ac29b26 100644 | |
--- a/src/builtins/cmp.pir | |
+++ b/src/builtins/cmp.pir | |
@@ -27,8 +27,12 @@ Swiped from Rakudo. | |
.sub 'infix:==' :multi(_,_) | |
.param pmc a | |
.param pmc b | |
- $I0 = iseq a, b | |
- .tailcall 'bool'($I0) | |
+ eq a, b, a_true | |
+ $P0 = get_hll_global 'false' | |
+ .return ($P0) | |
+ a_true: | |
+ $P0 = get_hll_global 'true' | |
+ .return ($P0) | |
.end | |
.sub 'infix:==' :multi(TrueClass,TrueClass) | |
@@ -74,20 +78,6 @@ Swiped from Rakudo. | |
.end | |
-.sub 'infix:==' :multi(Integer,Integer) | |
- .param pmc a | |
- .param pmc b | |
- $I0 = iseq a, b | |
- .tailcall 'bool'($I0) | |
-.end | |
- | |
-.sub 'infix:==' :multi(String,String) | |
- .param pmc a | |
- .param pmc b | |
- $I0 = iseq a, b | |
- .tailcall 'bool'($I0) | |
-.end | |
- | |
.sub 'infix:==' :multi(NilClass,_) | |
.param pmc a | |
.param pmc b | |
diff --git a/src/classes/Integer.pir b/src/classes/Integer.pir | |
index a4a5baf..09af692 100644 | |
--- a/src/classes/Integer.pir | |
+++ b/src/classes/Integer.pir | |
@@ -49,6 +49,11 @@ Returns a Perl representation of the CardinalInteger. | |
.return($P0) | |
.end | |
+.sub 'get_bool' :anon :vtable('get_bool') | |
+ $P0 = get_hll_global 'true' | |
+ .return ($P0) | |
+.end | |
+ | |
=item to_s() | |
Returns a CardinalString representation of the CardinalInteger. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment