]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.tree.identities: the identity on mod was useless too, because we already...
authorSlava Pestov <slava@factorcode.org>
Mon, 10 Oct 2011 19:31:47 +0000 (12:31 -0700)
committerSlava Pestov <slava@factorcode.org>
Mon, 10 Oct 2011 19:34:21 +0000 (12:34 -0700)
basis/compiler/tree/identities/identities.factor
basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor

index 279875dd1cdaa70568fec9f3393496e62bec6063..2153075d9cf8e10a4d8009cc29e326fa5c084261 100644 (file)
@@ -29,10 +29,6 @@ SYMBOL: X
     { { 0 X } drop }
 } define-identities
 
-\ mod {
-    { { X 1 } 0 }
-} define-identities
-
 \ bitand {
     { { X -1 } drop }
     { { -1 X } nip }
index b20ad3ee51e10d6e92cb4b97c316d10ee0d94de5..67612a40b720ff16f33bb913087c304ea77205cc 100644 (file)
@@ -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