]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix test failures from ratio/complex built-in removal
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 30 Apr 2009 05:38:55 +0000 (00:38 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 30 Apr 2009 05:38:55 +0000 (00:38 -0500)
basis/compiler/tests/codegen.factor
basis/compiler/tree/propagation/info/info.factor
basis/compiler/tree/propagation/slots/slots.factor
core/generic/math/math-tests.factor
core/generic/math/math.factor

index e45246fc1766864cc9060835490f1c91085af009..8fbe13ce51945bca40f457993e40f791ae0feaf8 100644 (file)
@@ -26,7 +26,7 @@ IN: compiler.tests.codegen
 
 [ 2 3 4 ] [ 3 [ 2 swap 4 ] compile-call ] unit-test
 
-[ { 1 2 3 } { 1 4 3 } 6 6 ]
+[ { 1 2 3 } { 1 4 3 } 2 2 ]
 [ { 1 2 3 } { 1 4 3 } [ over tag over tag ] compile-call ]
 unit-test
 
index a22b7aa1727f70f801c062b5a16279fffac94a17..2776ed914f44ee120eed9c705d74d48399d620b7 100644 (file)
@@ -70,18 +70,10 @@ DEFER: <literal-info>
     dup literal>> class >>class
     dup literal>> dup real? [ [a,a] >>interval ] [
         [ [-inf,inf] >>interval ] dip
-        {
-            { [ dup complex? ] [
-                [ real-part <literal-info> ]
-                [ imaginary-part <literal-info> ] bi
-                2array >>slots
-            ] }
-            { [ dup tuple? ] [
-                [ tuple-slots [ <literal-info> ] map ] [ class ] bi
-                read-only-slots >>slots
-            ] }
-            [ drop ]
-        } cond
+        dup tuple? [
+            [ tuple-slots [ <literal-info> ] map ] [ class ] bi
+            read-only-slots >>slots
+        ] [ drop ] if
     ] if ; inline
 
 : init-value-info ( info -- info )
index 1e221c89f15c3cef5493a964bff70b1600b634de..89c2bada8b24c2e97708f5bac0d64a7f508709f8 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: fry assocs arrays byte-arrays strings accessors sequences
 kernel slots classes.algebra classes.tuple classes.tuple.private
@@ -8,9 +8,6 @@ IN: compiler.tree.propagation.slots
 
 ! Propagation of immutable slots and array lengths
 
-! Revisit this code when delegation is removed and when complex
-! numbers become tuples.
-
 UNION: fixed-length-sequence array byte-array string ;
 
 : sequence-constructor? ( word -- ? )
index 12baeb64b5056685f85737c2d7c82a46f401e1c1..51e122431cfcffbc3b5b2bd5b775d421bbbb0778 100644 (file)
@@ -1,5 +1,5 @@
 IN: generic.math.tests
-USING: generic.math math tools.test ;
+USING: generic.math math tools.test kernel ;
 
 ! Test math-combination
 [ [ [ >float ] dip ] ] [ \ real \ float math-upgrade ] unit-test
@@ -7,10 +7,15 @@ USING: generic.math math tools.test ;
 [ [ [ >bignum ] dip ] ] [ \ fixnum \ bignum math-upgrade ] unit-test
 [ [ >float ] ] [ \ float \ integer math-upgrade ] unit-test
 
-[ number ] [ \ number \ float math-class-max ] unit-test
-[ float ] [ \ real \ float math-class-max ] unit-test
-[ fixnum ] [ \ fixnum \ null math-class-max ] unit-test
-[ bignum ] [ \ fixnum \ bignum math-class-max ] unit-test
-[ number ] [ \ fixnum \ number math-class-max ] unit-test
+[ number ] [ number float math-class-max ] unit-test
+[ number ] [ float number math-class-max ] unit-test
+[ float ] [ real float math-class-max ] unit-test
+[ float ] [ float real math-class-max ] unit-test
+[ fixnum ] [ fixnum null math-class-max ] unit-test
+[ fixnum ] [ null fixnum math-class-max ] unit-test
+[ bignum ] [ fixnum bignum math-class-max ] unit-test
+[ bignum ] [ bignum fixnum math-class-max ] unit-test
+[ number ] [ fixnum number math-class-max ] unit-test
+[ number ] [ number fixnum math-class-max ] unit-test
 
 
index f7e79e68bd6320882f1b54902790d952f5e592a4..c96050ad03dc38af22f083130127ea37b5ffb377 100644 (file)
@@ -22,11 +22,11 @@ PREDICATE: math-class < class
 
 : math-precedence ( class -- pair )
     [
-        { null fixnum bignum ratio float complex object } bootstrap-words
-        swap [ class<= ] curry find drop
+        { fixnum integer rational real number object } bootstrap-words
+        swap [ swap class<= ] curry find drop -1 or
     ] [
-        { null fixnum integer rational real number object } bootstrap-words
-        swap [ swap class<= ] curry find drop
+        { fixnum bignum ratio float complex object } bootstrap-words
+        swap [ class<= ] curry find drop -1 or
     ] bi 2array ;
 
 : (math-upgrade) ( max class -- quot )