diff --git a/CHANGES.html b/CHANGES.html index 5ab313438f..3437c32695 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -22,6 +22,8 @@
sort ( seq quot -- | quot: elt elt -- -1/0/1 )
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.binsearch ( elt seq quot -- i | quot: elt elt -- -1/0/1 )
and binsearch ( elt seq quot -- elt | quot: elt elt -- -1/0/1 )
combinators perform a binary search on a sorted sequence.2each ( seq seq quot -- quot: elt -- elt )
combinatorjoin ( seq glue -- seq )
word. Takes a sequence of sequences, and constructs a new sequence with the glue in between each sequence. For example:
[ "usr" "bin" "grep" ] "/" join @@ -79,7 +81,7 @@ make-sbuf ==> SBUF" " make
sleep ( ms -- )
word pauses current thread for a number of milliseconds.with-datastack ( stack word -- stack )
combinator.cond ( conditions -- )
combinator. It behaves like a set of nested ifte
s, and compiles if each branch has the same stack effect. See its documentation comment for details.G:
syntax) in handbook.
+G:
syntax) in handbook.contrib/concurrency
(Chris Double).contrib/algebra/
. Now, vector operations are possible
and the syntax doesn't use so many spaces. New way to write the quadratic formula:
diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt
index 8b7b2844fe..a4bf89eed7 100644
--- a/TODO.FACTOR.txt
+++ b/TODO.FACTOR.txt
@@ -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
diff --git a/library/compiler/ppc/generator.factor b/library/compiler/ppc/generator.factor
index 04ad255895..08c3b149e5 100644
--- a/library/compiler/ppc/generator.factor
+++ b/library/compiler/ppc/generator.factor
@@ -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 ;
diff --git a/library/inference/call-optimizers.factor b/library/inference/call-optimizers.factor
index 66db22caad..41229b3527 100644
--- a/library/inference/call-optimizers.factor
+++ b/library/inference/call-optimizers.factor
@@ -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 -- ? )
diff --git a/library/test/compiler/optimizer.factor b/library/test/compiler/optimizer.factor
index e56ce41343..3b92a6fd24 100644
--- a/library/test/compiler/optimizer.factor
+++ b/library/test/compiler/optimizer.factor
@@ -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
diff --git a/library/ui/ui.factor b/library/ui/ui.factor
index 07371e0fb8..e9edf02abc 100644
--- a/library/ui/ui.factor
+++ b/library/ui/ui.factor
@@ -22,7 +22,7 @@ styles threads words ;
ttf-init
global [