<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
<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:
\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
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 ;
[ 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 -- ? )
: 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
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
: ?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.
IN: kernel
-: version "0.77" ;
+: version "0.78" ;