]> gitweb.factorcode.org Git - factor.git/commitdiff
Remove identities on / and rem, which were no-ops because integer-derived-ops would...
authorSlava Pestov <slava@factorcode.org>
Sun, 9 Oct 2011 20:51:03 +0000 (13:51 -0700)
committerSlava Pestov <slava@factorcode.org>
Sun, 9 Oct 2011 20:51:03 +0000 (13:51 -0700)
basis/compiler/tree/identities/identities.factor

index 00632ec6f6bc5af37025a151d3f635db802e60c8..279875dd1cdaa70568fec9f3393496e62bec6063 100644 (file)
@@ -8,7 +8,7 @@ compiler.tree.propagation.info ;
 IN: compiler.tree.identities
 
 : define-identities ( word identities -- )
-    [ integer-derived-ops ] dip
+    [ integer-derived-ops dup empty? f assert= ] dip
     '[ _ "identities" set-word-prop ] each ;
 
 SYMBOL: X
@@ -29,18 +29,10 @@ SYMBOL: X
     { { 0 X } drop }
 } define-identities
 
-\ / {
-    { { X 1 } drop }
-} define-identities
-
 \ mod {
     { { X 1 } 0 }
 } define-identities
 
-\ rem {
-    { { X 1 } 0 }
-} define-identities
-
 \ bitand {
     { { X -1 } drop }
     { { -1 X } nip }