From 7bc38641f9bafb8b9ad4a7cea40a1ee9ea663689 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 10 Oct 2011 12:31:47 -0700 Subject: [PATCH] compiler.tree.identities: the identity on mod was useless too, because we already have a rewrite rule which handles this case in compiler.tree.propagation --- basis/compiler/tree/identities/identities.factor | 4 ---- .../tree/modular-arithmetic/modular-arithmetic-tests.factor | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/basis/compiler/tree/identities/identities.factor b/basis/compiler/tree/identities/identities.factor index 279875dd1c..2153075d9c 100644 --- a/basis/compiler/tree/identities/identities.factor +++ b/basis/compiler/tree/identities/identities.factor @@ -29,10 +29,6 @@ SYMBOL: X { { 0 X } drop } } define-identities -\ mod { - { { X 1 } 0 } -} define-identities - \ bitand { { { X -1 } drop } { { -1 X } nip } diff --git a/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor b/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor index b20ad3ee51..67612a40b7 100644 --- a/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor +++ b/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor @@ -134,6 +134,12 @@ TUPLE: declared-fixnum { x fixnum } ; ] { mod fixnum-mod rem } inlined? ] unit-test +[ [ drop 0 ] ] +[ [ >integer 1 rem ] test-modular-arithmetic ] unit-test + +[ [ drop 0 ] ] +[ [ >integer 1 mod ] test-modular-arithmetic ] unit-test + [ [ >fixnum 255 >R R> fixnum-bitand ] ] [ [ >integer 256 rem ] test-modular-arithmetic ] unit-test