fix compiler bug uncovered by doublec

cvs
Slava Pestov 2005-09-04 02:28:46 +00:00
parent 99d8520dda
commit 16196db489
7 changed files with 27 additions and 8 deletions

View 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:

View File

@ -66,6 +66,7 @@
+ kernel:
- friendlier .factor-rc load error handling
- reader syntax for arrays, byte arrays, displaced aliens
- out of memory error when printing global namespace
- first time hash/vector is grown, set size to something big

View 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 ;

View 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 -- ? )

View 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

View 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.

View File

@ -1,2 +1,2 @@
IN: kernel
: version "0.77" ;
: version "0.78" ;