Skip to content

Commit

Permalink
Move == and != from PIR cheats into operators.pm.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Feb 11, 2010
1 parent 54dabc9 commit 7085c8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/cheats/relops.pir
Expand Up @@ -12,24 +12,6 @@ src/cheats/cmp.pir - Perl6 comparison builtins

.namespace []

.sub '&infix:<==>' :multi(_,_)
.param num a
.param num b
$I0 = iseq a, b
.return ($I0)
# .tailcall '&prefix:?'($I0)
.end


.sub '&infix:<!=>' :multi(_,_)
.param num a
.param num b
$I0 = isne a, b
.return ($I0)
# .tailcall '&prefix:?'($I0)
.end


.sub '&infix:<<>' :multi(_,_)
.param num a
.param num b
Expand Down
8 changes: 8 additions & 0 deletions src/core/operators.pm
Expand Up @@ -147,6 +147,14 @@ our multi infix:sym<//>($a, $b) {
$a.defined ?? $a !! $b
}

our multi infix:<==>($a, $b) {
pir::iseq__INN(+$a, +$b) ?? True !! False
}

our multi infix:<!=>($a, $b) {
pir::isne__INN(+$a, +$b) ?? True !! False
}

# XXX Wants to be a macro when we have them.
our sub WHAT(\$x) {
$x.WHAT
Expand Down

0 comments on commit 7085c8d

Please sign in to comment.