]> gitweb.factorcode.org Git - factor.git/commitdiff
fix compiler bug uncovered by doublec
authorSlava Pestov <slava@factorcode.org>
Sun, 4 Sep 2005 02:28:46 +0000 (02:28 +0000)
committerSlava Pestov <slava@factorcode.org>
Sun, 4 Sep 2005 02:28:46 +0000 (02:28 +0000)
CHANGES.html
TODO.FACTOR.txt
library/compiler/ppc/generator.factor
library/inference/call-optimizers.factor
library/test/compiler/optimizer.factor
library/ui/ui.factor
version.factor

index 5ab313438fadbddc09536a416029ff6f20557f13..3437c32695d86fdadf4f225bc367c3a016d530ea 100644 (file)
@@ -22,6 +22,8 @@
 <li>Collections:
 
 <ul>
+<li><code>sort ( seq quot -- | quot: elt elt -- -1/0/1 )</code> combinator now works with any sequence, not just a list. The comparator also has to return a signed integer, not just a boolean. It is much faster than the old sorting algorithm.</li>
+<li><code>binsearch ( elt seq quot -- i | quot: elt elt -- -1/0/1 )</code> and <code>binsearch ( elt seq quot -- elt | quot: elt elt -- -1/0/1 )</code> combinators perform a binary search on a sorted sequence.</li>
 <li><code>2each ( seq seq quot -- quot: elt -- elt )</code> combinator</li>
 <li><code>join ( seq glue -- seq )</code> word. Takes a sequence of sequences, and constructs a new sequence with the glue in between each sequence. For example:
 <pre>  [ "usr" "bin" "grep" ] "/" join
@@ -79,7 +81,7 @@ make-sbuf    ==&gt; SBUF" " make
 <li>New <code>sleep ( ms -- )</code> word pauses current thread for a number of milliseconds.</li>
 <li>New <code>with-datastack ( stack word -- stack )</code> combinator.</li>
 <li>New <code>cond ( conditions -- )</code> combinator. It behaves like a set of nested <code>ifte</code>s, and compiles if each branch has the same stack effect. See its documentation comment for details.</li>
-<li>Formally documented method combination (<code>G:</code> syntax) in handbook.
+<li>Formally documented method combination (<code>G:</code> syntax) in handbook.</li>
 <li>Erlang/Termite-style concurrency library in <code>contrib/concurrency</code> (Chris Double).</li>
 <li>Completely redid infix algebra in <code>contrib/algebra/</code>. Now, vector operations are possible
 and the syntax doesn't use so many spaces. New way to write the quadratic formula:
index 8b7b2844fedf6e32a492788777d0565767effafb..a4bf89eed7360ab203bad19ba2069ed3dd83f1ff 100644 (file)
@@ -66,6 +66,7 @@
 \r
 + kernel:\r
 \r
+- friendlier .factor-rc load error handling\r
 - reader syntax for arrays, byte arrays, displaced aliens\r
 - out of memory error when printing global namespace\r
 - first time hash/vector is grown, set size to something big\r
index 04ad2558956ca6fdd0c93b8abc5cd542c127ae19..08c3b149e5ce8194df291df15345d32dce3d7484 100644 (file)
@@ -125,4 +125,4 @@ M: %type generate-node ( vop -- )
     17 18 MR ;
 
 M: %tag generate-node ( vop -- )
-    dup vop-in-1 swap vop-out-1 tag-mask ANDI ;
+    dup vop-in-1 v>operand swap vop-out-1 v>operand tag-mask ANDI ;
index 66db22caad78acbf4ff9c2e472e1546071401917..41229b3527e6c5eafa3a770be900a0aa9f1cfff3 100644 (file)
@@ -37,11 +37,21 @@ sequences vectors words ;
         [ 3drop t ] [ inline-literals ] ifte
     ] catch ;
 
-: flip-branches ( #ifte -- )
+: flip-subst ( not -- )
+    #! Note: cloning the vectors, since subst-values will modify
+    #! them.
+    [ node-in-d clone ] keep
+    [ node-out-d clone ] keep
+    subst-values ;
+
+: flip-branches ( not -- #ifte )
+    #! If a not is followed by an #ifte, flip branches and
+    #! remove the note.
+    dup flip-subst node-successor dup
     dup node-children first2 swap 2vector swap set-node-children ;
 
 \ not {
-    { [ dup node-successor #ifte? ] [ node-successor dup flip-branches ] }
+    { [ dup node-successor #ifte? ] [ flip-branches ] }
 } define-optimizers
 
 : disjoint-eq? ( node -- ? )
index e56ce41343a86edcf7e46ee8bb1f196f7d2df3e4..3b92a6fd24cc4c2e34c691c556b1d9c9de208768 100644 (file)
@@ -171,3 +171,9 @@ TUPLE: pred-test ;
 : fixnum-declarations >fixnum 24 shift 1234 bitxor ; compiled
 
 [ ] [ 1000000 fixnum-declarations . ] unit-test
+
+! regression
+
+: literal-not-branch 0 not [ ] [ ] ifte ; compiled
+
+[ ] [ literal-not-branch ] unit-test
index 07371e0fb8a39f3a57ec711c3d495f60853f823f..e9edf02abc6f846e1de91fcf85c758a993c4a81f 100644 (file)
@@ -22,7 +22,7 @@ styles threads words ;
     ttf-init
     global [
         <world> world set
-        { 600 800 0 } world get set-gadget-dim
+        { 600 700 0 } world get set-gadget-dim
         
         world-theme world get set-gadget-paint
 
@@ -38,11 +38,11 @@ global [ first-time on ] bind
 : ?init-world
     first-time get [ init-world first-time off ] when ;
 
-IN: shells
-
 : ui-title
     [ "Factor " % version % " - " % "image" get % ] "" make ;
 
+IN: shells
+
 : ui ( -- )
     #! Start the Factor graphics subsystem with the given screen
     #! dimensions.
index d66bf72f8ade744696e18b08524a050ebfe73275..ecfd53c25f3856e2ca1155e9d535988df0e4d978 100644 (file)
@@ -1,2 +1,2 @@
 IN: kernel
-: version "0.77" ;
+: version "0.78" ;