fix compiler bug uncovered by doublec
parent
99d8520dda
commit
16196db489
|
@ -22,6 +22,8 @@
|
||||||
<li>Collections:
|
<li>Collections:
|
||||||
|
|
||||||
<ul>
|
<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>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:
|
<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
|
<pre> [ "usr" "bin" "grep" ] "/" join
|
||||||
|
@ -79,7 +81,7 @@ make-sbuf ==> SBUF" " make
|
||||||
<li>New <code>sleep ( ms -- )</code> word pauses current thread for a number of milliseconds.</li>
|
<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>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>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>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
|
<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:
|
and the syntax doesn't use so many spaces. New way to write the quadratic formula:
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
|
|
||||||
+ kernel:
|
+ kernel:
|
||||||
|
|
||||||
|
- friendlier .factor-rc load error handling
|
||||||
- reader syntax for arrays, byte arrays, displaced aliens
|
- reader syntax for arrays, byte arrays, displaced aliens
|
||||||
- out of memory error when printing global namespace
|
- out of memory error when printing global namespace
|
||||||
- first time hash/vector is grown, set size to something big
|
- first time hash/vector is grown, set size to something big
|
||||||
|
|
|
@ -125,4 +125,4 @@ M: %type generate-node ( vop -- )
|
||||||
17 18 MR ;
|
17 18 MR ;
|
||||||
|
|
||||||
M: %tag generate-node ( vop -- )
|
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 ;
|
||||||
|
|
|
@ -37,11 +37,21 @@ sequences vectors words ;
|
||||||
[ 3drop t ] [ inline-literals ] ifte
|
[ 3drop t ] [ inline-literals ] ifte
|
||||||
] catch ;
|
] 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 ;
|
dup node-children first2 swap 2vector swap set-node-children ;
|
||||||
|
|
||||||
\ not {
|
\ not {
|
||||||
{ [ dup node-successor #ifte? ] [ node-successor dup flip-branches ] }
|
{ [ dup node-successor #ifte? ] [ flip-branches ] }
|
||||||
} define-optimizers
|
} define-optimizers
|
||||||
|
|
||||||
: disjoint-eq? ( node -- ? )
|
: disjoint-eq? ( node -- ? )
|
||||||
|
|
|
@ -171,3 +171,9 @@ TUPLE: pred-test ;
|
||||||
: fixnum-declarations >fixnum 24 shift 1234 bitxor ; compiled
|
: fixnum-declarations >fixnum 24 shift 1234 bitxor ; compiled
|
||||||
|
|
||||||
[ ] [ 1000000 fixnum-declarations . ] unit-test
|
[ ] [ 1000000 fixnum-declarations . ] unit-test
|
||||||
|
|
||||||
|
! regression
|
||||||
|
|
||||||
|
: literal-not-branch 0 not [ ] [ ] ifte ; compiled
|
||||||
|
|
||||||
|
[ ] [ literal-not-branch ] unit-test
|
||||||
|
|
|
@ -22,7 +22,7 @@ styles threads words ;
|
||||||
ttf-init
|
ttf-init
|
||||||
global [
|
global [
|
||||||
<world> world set
|
<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
|
world-theme world get set-gadget-paint
|
||||||
|
|
||||||
|
@ -38,11 +38,11 @@ global [ first-time on ] bind
|
||||||
: ?init-world
|
: ?init-world
|
||||||
first-time get [ init-world first-time off ] when ;
|
first-time get [ init-world first-time off ] when ;
|
||||||
|
|
||||||
IN: shells
|
|
||||||
|
|
||||||
: ui-title
|
: ui-title
|
||||||
[ "Factor " % version % " - " % "image" get % ] "" make ;
|
[ "Factor " % version % " - " % "image" get % ] "" make ;
|
||||||
|
|
||||||
|
IN: shells
|
||||||
|
|
||||||
: ui ( -- )
|
: ui ( -- )
|
||||||
#! Start the Factor graphics subsystem with the given screen
|
#! Start the Factor graphics subsystem with the given screen
|
||||||
#! dimensions.
|
#! dimensions.
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
IN: kernel
|
IN: kernel
|
||||||
: version "0.77" ;
|
: version "0.78" ;
|
||||||
|
|
Loading…
Reference in New Issue