]> gitweb.factorcode.org Git - factor.git/commitdiff
Fixing unit test failures
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 2 Jul 2008 20:57:38 +0000 (15:57 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 2 Jul 2008 20:57:38 +0000 (15:57 -0500)
37 files changed:
core/alien/alien-tests.factor
core/assocs/assocs-tests.factor
core/bit-arrays/authors.txt [deleted file]
core/bit-arrays/bit-arrays-docs.factor [deleted file]
core/bit-arrays/bit-arrays-tests.factor [deleted file]
core/bit-arrays/bit-arrays.factor [deleted file]
core/bit-arrays/summary.txt [deleted file]
core/bit-arrays/tags.txt [deleted file]
core/classes/tuple/tuple-tests.factor
core/compiler/tests/intrinsics.factor
core/float-arrays/authors.txt [deleted file]
core/float-arrays/float-arrays-docs.factor [deleted file]
core/float-arrays/float-arrays-tests.factor [deleted file]
core/float-arrays/float-arrays.factor [deleted file]
core/float-arrays/summary.txt [deleted file]
core/float-arrays/tags.txt [deleted file]
core/inference/class/class-tests.factor
core/sequences/sequences-tests.factor
extra/benchmark/dispatch2/dispatch2.factor
extra/benchmark/dispatch3/dispatch3.factor
extra/benchmark/fasta/fasta.factor
extra/bit-arrays/bit-arrays-tests.factor
extra/bit-vectors/bit-vectors-docs.factor
extra/float-vectors/float-vectors-docs.factor
extra/io/launcher/launcher.factor
extra/jamshred/gl/gl.factor
extra/jamshred/player/player.factor
extra/jamshred/tunnel/tunnel-tests.factor
extra/maze/deploy.factor
extra/random/unix/unix.factor
extra/serialize/serialize-tests.factor
extra/serialize/serialize.factor
extra/tools/deploy/deploy-tests.factor
extra/tools/deploy/shaker/shaker.factor
extra/tools/deploy/shaker/strip-cocoa.factor
extra/ui/gadgets/panes/panes-tests.factor
extra/ui/gestures/gestures.factor

index 28a1e987102be5228720b698301153af840478f5..9be28858887275dcbfe54e177d8e9fb2ce22bde3 100755 (executable)
@@ -58,8 +58,6 @@ cell 8 = [
 [ "ALIEN: 1234" ] [ 1234 <alien> unparse ] unit-test
 
 [ ] [ 0 B{ 1 2 3 } <displaced-alien> drop ] unit-test
-[ ] [ 0 F{ 1 2 3 } <displaced-alien> drop ] unit-test
-[ ] [ 0 ?{ t f t } <displaced-alien> drop ] unit-test
 
 [ 0 B{ 1 2 3 } <displaced-alien> alien-address ] must-fail
 
index 43a1bac82d8522bf569d55bc89c326453ffbad4e..4a44dbd6417196ee93c5c36460e3fc6b0cc35444 100755 (executable)
@@ -1,7 +1,7 @@
 IN: assocs.tests
 USING: kernel math namespaces tools.test vectors sequences
 sequences.private hashtables io prettyprint assocs
-continuations ;
+continuations float-arrays ;
 
 [ t ] [ H{ } dup assoc-subset? ] unit-test
 [ f ] [ H{ { 1 3 } } H{ } assoc-subset? ] unit-test
diff --git a/core/bit-arrays/authors.txt b/core/bit-arrays/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/core/bit-arrays/bit-arrays-docs.factor b/core/bit-arrays/bit-arrays-docs.factor
deleted file mode 100644 (file)
index 6f3afe0..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-USING: arrays help.markup help.syntax kernel
-kernel.private math prettyprint strings vectors sbufs ;
-IN: bit-arrays
-
-ARTICLE: "bit-arrays" "Bit arrays"
-"Bit array are a fixed-size mutable sequences (" { $link "sequence-protocol" } ") whose elements are either " { $link t } " or " { $link f } ". Each element only uses one bit of storage, hence the name. The literal syntax is covered in " { $link "syntax-bit-arrays" } "."
-$nl
-"Bit array words are in the " { $vocab-link "bit-arrays" } " vocabulary."
-$nl
-"Bit arrays play a special role in the C library interface; they can be used to pass binary data back and forth between Factor and C. See " { $link "c-byte-arrays" } "."
-$nl
-"Bit arrays form a class of objects:"
-{ $subsection bit-array }
-{ $subsection bit-array? }
-"Creating new bit arrays:"
-{ $subsection >bit-array }
-{ $subsection <bit-array> }
-"Efficiently setting and clearing all bits in a bit array:"
-{ $subsection set-bits }
-{ $subsection clear-bits }
-"Converting between unsigned integers and their binary representation:"
-{ $subsection integer>bit-array }
-{ $subsection bit-array>integer } ;
-
-ABOUT: "bit-arrays"
-
-HELP: bit-array
-{ $description "The class of fixed-length bit arrays. See " { $link "syntax-bit-arrays" } " for syntax and " { $link "bit-arrays" } " for general information." } ;
-
-HELP: <bit-array> ( n -- bit-array )
-{ $values { "n" "a non-negative integer" } { "bit-array" "a new " { $link bit-array } } }
-{ $description "Creates a new bit array with the given length and all elements initially set to " { $link f } "." } ;
-
-HELP: >bit-array
-{ $values { "seq" "a sequence" } { "bit-array" bit-array } }
-{ $description "Outputs a freshly-allocated bit array whose elements have the same boolean values as a given sequence." } ;
-
-HELP: clear-bits
-{ $values { "bit-array" bit-array } }
-{ $description "Sets all elements of the bit array to " { $link f } "." }
-{ $notes "Calling this word is more efficient than the following:"
-    { $code "[ drop f ] change-each" }
-}
-{ $side-effects "bit-array" } ;
-
-HELP: set-bits
-{ $values { "bit-array" bit-array } }
-{ $description "Sets all elements of the bit array to " { $link t } "." }
-{ $notes "Calling this word is more efficient than the following:"
-    { $code "[ drop t ] change-each" }
-}
-{ $side-effects "bit-array" } ;
-
-HELP: integer>bit-array
-{ $values { "integer" integer } { "bit-array" bit-array } }
-{ $description "Outputs a freshly-allocated bit array whose elements correspond to the bits in the binary representation of the given unsigned integer value." }
-{ $notes "The bits of the integer are stored in the resulting bit array in order of ascending significance, least significant bit first. This word will fail if passed a negative integer. If you want the two's-complement binary representation of a negative number, use " { $link bitnot } " to get the complement of the number first. This word works with fixnums or bignums of any size; it is not limited by fixnum size or machine word size." } ;
-
-HELP: bit-array>integer
-{ $values { "bit-array" bit-array } { "integer" integer } }
-{ $description "Outputs the unsigned integer whose binary representation corresponds to the contents of the given bit array." }
-{ $notes "The bits of the integer are taken from the bit array in order of ascending significance, least significant bit first. This word is able to return fixnums or bignums of any size; it is not limited by fixnum size or machine word size." } ;
diff --git a/core/bit-arrays/bit-arrays-tests.factor b/core/bit-arrays/bit-arrays-tests.factor
deleted file mode 100755 (executable)
index b41cf9c..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-USING: sequences arrays bit-arrays kernel tools.test math
-random ;
-IN: bit-arrays.tests
-
-[ 100 ] [ 100 <bit-array> length ] unit-test
-
-[
-    { t f t }
-] [
-    3 <bit-array> t 0 pick set-nth t 2 pick set-nth
-    >array
-] unit-test
-
-[
-    { t f t }
-] [
-    { t f t } >bit-array >array
-] unit-test
-
-[
-    { t f t } { f t f }
-] [
-    { t f t } >bit-array dup clone dup [ not ] change-each
-    [ >array ] bi@
-] unit-test
-
-[
-    { f f f f f }
-] [
-    { t f t t f } >bit-array dup clear-bits >array
-] unit-test
-
-[
-    { t t t t t }
-] [
-    { t f t t f } >bit-array dup set-bits >array
-] unit-test
-
-[ t ] [
-    100 [
-        drop 100 [ 2 random zero? ] replicate
-        dup >bit-array >array =
-    ] all?
-] unit-test
-
-[ ?{ f } ] [
-    1 2 { t f t f } <slice> >bit-array
-] unit-test
-
-[ ?{ t f t f f f } ] [ 6 ?{ t f t } resize-bit-array ] unit-test
-
-[ ?{ t t } ] [ 2 ?{ t t f t f t f t t t f t } resize-bit-array ] unit-test
-
-[ -10 ?{ } resize-bit-array ] must-fail
-
-[ -1 integer>bit-array ] must-fail
-[ ?{ f t } ] [ 2 integer>bit-array ] unit-test
-[ ?{ t t t t t t t t t } ] [ 511 integer>bit-array ] unit-test
-[ ?{ 
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-} ] [
-    HEX: ffffffffffffffffffffffffffffffff integer>bit-array
-] unit-test
-
-[ 14 ] [ ?{ f t t t } bit-array>integer ] unit-test
-[ HEX: ffffffffffffffffffffffffffffffff ] [ ?{
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-    t t t t t t t t   t t t t t t t t   t t t t t t t t  t t t t t t t t
-} bit-array>integer ] unit-test
diff --git a/core/bit-arrays/bit-arrays.factor b/core/bit-arrays/bit-arrays.factor
deleted file mode 100755 (executable)
index 4446bb5..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: math alien.accessors kernel kernel.private sequences
-sequences.private ;
-IN: bit-arrays
-
-<PRIVATE
-
-: n>byte -3 shift ; inline
-
-: byte/bit ( n alien -- byte bit )
-    over n>byte alien-unsigned-1 swap 7 bitand ; inline
-
-: set-bit ( ? byte bit -- byte )
-    2^ rot [ bitor ] [ bitnot bitand ] if ; inline
-
-: bits>cells 31 + -5 shift ; inline
-
-: (set-bits) ( bit-array n -- )
-    over length bits>cells -rot [
-        spin 4 * set-alien-unsigned-4
-    ] 2curry each ; inline
-
-PRIVATE>
-
-M: bit-array length array-capacity ;
-
-M: bit-array nth-unsafe
-    >r >fixnum r> byte/bit bit? ;
-
-M: bit-array set-nth-unsafe
-    >r >fixnum r>
-    [ byte/bit set-bit ] 2keep
-    swap n>byte set-alien-unsigned-1 ;
-
-: clear-bits ( bit-array -- ) 0 (set-bits) ;
-
-: set-bits ( bit-array -- ) -1 (set-bits) ;
-
-M: bit-array clone (clone) ;
-
-: >bit-array ( seq -- bit-array ) ?{ } clone-like ; inline
-
-M: bit-array like drop dup bit-array? [ >bit-array ] unless ;
-
-M: bit-array new-sequence drop <bit-array> ;
-
-M: bit-array equal?
-    over bit-array? [ sequence= ] [ 2drop f ] if ;
-
-M: bit-array resize
-    resize-bit-array ;
-
-: integer>bit-array ( int -- bit-array ) 
-    [ log2 1+ <bit-array> 0 ] keep
-    [ dup zero? not ] [
-        [ -8 shift ] [ 255 bitand ] bi
-        -roll [ [ set-alien-unsigned-1 ] 2keep 1+ ] dip
-    ] [ ] while
-    2drop ;
-
-: bit-array>integer ( bit-array -- int )
-    dup >r length 7 + n>byte 0 r> [
-        swap alien-unsigned-1 swap 8 shift bitor
-    ] curry reduce ;
-
-INSTANCE: bit-array sequence
diff --git a/core/bit-arrays/summary.txt b/core/bit-arrays/summary.txt
deleted file mode 100644 (file)
index 8844bfc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Fixed-size bit arrays
diff --git a/core/bit-arrays/tags.txt b/core/bit-arrays/tags.txt
deleted file mode 100644 (file)
index 42d711b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-collections
index 43a70faa6c86990f4647bb455607183eba1b7e50..c2bd10b68a21400ae2b7cb7ca19b1588068f11e4 100755 (executable)
@@ -655,4 +655,4 @@ T{ reshape-test f "hi" } "tuple" set
 
 TUPLE: boa-coercer-test { x array-capacity } ;
 
-[ fixnum ] [ 0 >bignum boa-coercer-test boa x>> ] unit-test
+[ fixnum ] [ 0 >bignum boa-coercer-test boa x>> class ] unit-test
index 4ae48c09b4de20262a98403711b26a4a07151873..42becc5588dcb357d6ed830384b2a77d68cdd372 100755 (executable)
@@ -1,8 +1,8 @@
 USING: accessors arrays compiler.units kernel kernel.private math
 math.constants math.private sequences strings tools.test words
 continuations sequences.private hashtables.private byte-arrays
-strings.private system random layouts vectors.private
-sbufs.private strings.private slots.private alien math.order
+strings.private system random layouts vectors
+sbufs strings.private slots.private alien math.order
 alien.accessors alien.c-types alien.syntax alien.strings
 namespaces libc sequences.private io.encodings.ascii ;
 IN: compiler.tests
diff --git a/core/float-arrays/authors.txt b/core/float-arrays/authors.txt
deleted file mode 100755 (executable)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/core/float-arrays/float-arrays-docs.factor b/core/float-arrays/float-arrays-docs.factor
deleted file mode 100644 (file)
index cb36aad..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-USING: arrays bit-arrays vectors strings sbufs
-kernel help.markup help.syntax math ;
-IN: float-arrays
-
-ARTICLE: "float-arrays" "Float arrays"
-"Float arrays are fixed-size mutable sequences (" { $link "sequence-protocol" } ") whose elements are instances of " { $link float } ". Elements are unboxed, hence the memory usage is lower than an equivalent " { $link array } " of floats. The literal syntax is covered in " { $link "syntax-float-arrays" } "."
-$nl
-"Float array words are in the " { $vocab-link "float-arrays" } " vocabulary."
-$nl
-"Float arrays play a special role in the C library interface; they can be used to pass binary data back and forth between Factor and C. See " { $link "c-byte-arrays" } "."
-$nl
-"Float arrays form a class of objects."
-{ $subsection float-array }
-{ $subsection float-array? }
-"There are several ways to construct float arrays."
-{ $subsection >float-array }
-{ $subsection <float-array> }
-"Creating a float array from several elements on the stack:"
-{ $subsection 1float-array }
-{ $subsection 2float-array }
-{ $subsection 3float-array }
-{ $subsection 4float-array } ;
-
-ABOUT: "float-arrays"
-
-HELP: float-array
-{ $description "The class of float arrays. See " { $link "syntax-float-arrays" } " for syntax and " { $link "float-arrays" } " for general information." } ;
-
-HELP: <float-array> ( n initial -- float-array )
-{ $values { "n" "a non-negative integer" } { "initial" float } { "float-array" "a new float array" } }
-{ $description "Creates a new float array holding " { $snippet "n" } " floats with the specified initial element." } ;
-
-HELP: >float-array
-{ $values { "seq" "a sequence" } { "float-array" float-array } }
-{ $description "Outputs a freshly-allocated float array whose elements have the same floating-point values as a given sequence." }
-{ $errors "Throws an error if the sequence contains elements other than real numbers." } ;
-
-HELP: 1float-array
-{ $values { "x" object } { "array" float-array } }
-{ $description "Create a new float array with one element." } ;
-
-{ 1array 2array 3array 4array } related-words
-
-HELP: 2float-array
-{ $values { "x" object } { "y" object } { "array" float-array } }
-{ $description "Create a new float array with two elements, with " { $snippet "x" } " appearing first." } ;
-
-HELP: 3float-array
-{ $values { "x" object } { "y" object } { "z" object } { "array" float-array } }
-{ $description "Create a new float array with three elements, with " { $snippet "x" } " appearing first." } ;
-
-HELP: 4float-array
-{ $values { "w" object } { "x" object } { "y" object } { "z" object } { "array" float-array } }
-{ $description "Create a new float array with four elements, with " { $snippet "w" } " appearing first." } ;
diff --git a/core/float-arrays/float-arrays-tests.factor b/core/float-arrays/float-arrays-tests.factor
deleted file mode 100755 (executable)
index 0918eec..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-IN: float-arrays.tests
-USING: float-arrays tools.test ;
-
-[ F{ 1.0 1.0 1.0 } ] [ 3 1.0 <float-array> ] unit-test
-
-[ F{ 1 2 3 0 0 0 } ] [ 6 F{ 1 2 3 } resize-float-array ] unit-test
-
-[ F{ 1 2 } ] [ 2 F{ 1 2 3 4 5 6 7 8 9 } resize-float-array ] unit-test
-
-[ -10 F{ } resize-float-array ] must-fail
diff --git a/core/float-arrays/float-arrays.factor b/core/float-arrays/float-arrays.factor
deleted file mode 100755 (executable)
index d25d447..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel kernel.private alien.accessors sequences
-sequences.private math math.private ;
-IN: float-arrays
-
-<PRIVATE
-
-: float-array@ swap >fixnum 8 fixnum*fast ; inline
-
-PRIVATE>
-
-M: float-array clone (clone) ;
-M: float-array length array-capacity ;
-
-M: float-array nth-unsafe
-    float-array@ alien-double ;
-
-M: float-array set-nth-unsafe
-    >r >r >float r> r> float-array@ set-alien-double ;
-
-: >float-array ( seq -- float-array ) F{ } clone-like ; inline
-
-M: float-array like
-    drop dup float-array? [ >float-array ] unless ;
-
-M: float-array new-sequence drop 0.0 <float-array> ;
-
-M: float-array equal?
-    over float-array? [ sequence= ] [ 2drop f ] if ;
-
-M: float-array resize
-    resize-float-array ;
-
-INSTANCE: float-array sequence
-
-: 1float-array ( x -- array ) 1 swap <float-array> ; flushable
-
-: 2float-array ( x y -- array ) F{ } 2sequence ; flushable
-
-: 3float-array ( x y z -- array ) F{ } 3sequence ; flushable
-
-: 4float-array ( w x y z -- array ) F{ } 4sequence ; flushable
diff --git a/core/float-arrays/summary.txt b/core/float-arrays/summary.txt
deleted file mode 100644 (file)
index 0eac3b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Efficient fixed-length floating point number arrays
diff --git a/core/float-arrays/tags.txt b/core/float-arrays/tags.txt
deleted file mode 100644 (file)
index 42d711b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-collections
index ba1e3d89a3edb4dac29baa0f126b8cbd59af7c0e..591baf128793427ddf351801b12ca9acf7d51a98 100755 (executable)
@@ -4,8 +4,9 @@ inference.dataflow optimizer tools.test kernel.private generic
 sequences words inference.class quotations alien
 alien.c-types strings sbufs sequences.private
 slots.private combinators definitions compiler.units
-system layouts vectors optimizer.math.partial accessors
-optimizer.inlining math.order hashtables classes ;
+system layouts vectors optimizer.math.partial
+optimizer.inlining optimizer.backend math.order
+accessors hashtables classes assocs ;
 
 [ t ] [ T{ literal-constraint f 1 2 } T{ literal-constraint f 1 2 } equal? ] unit-test
 
@@ -576,7 +577,15 @@ M: integer detect-integer ;
 ] unit-test
 
 [ t ] [
-    [ hashtable instance? ] \ instance? inlined?
+    [ { hashtable } declare hashtable instance? ] \ instance? inlined?
+] unit-test
+
+[ t ] [
+    [ { vector } declare hashtable instance? ] \ instance? inlined?
+] unit-test
+
+[ f ] [
+    [ { assoc } declare hashtable instance? ] \ instance? inlined?
 ] unit-test
 
 TUPLE: declared-fixnum { x fixnum } ;
index b500f69045542cfbe82faa9789e45ed16bd813df..a12184690d88fff53ae64e50674869cffd07ae23 100755 (executable)
@@ -222,8 +222,6 @@ unit-test
 
 [ f ] [ f V{ } like f V{ } like eq? ] unit-test
 
-[ ?{ f t } ] [ 0 2 ?{ f t f } subseq ] unit-test
-
 [ V{ f f f } ] [ 3 V{ } new-sequence ] unit-test
 [ SBUF" \0\0\0" ] [ 3 SBUF" " new-sequence ] unit-test
 
index 4e4d3f8bd577541770f4c1beccae27320cee8436..7145cd94f7a60facef902fe6fae943a4daa37d9d 100644 (file)
@@ -1,5 +1,5 @@
 USING: namespaces math sequences splitting grouping
-kernel columns ;
+kernel columns float-arrays bit-arrays ;
 IN: benchmark.dispatch2
 
 : sequences ( -- seq )
index 4e4712a1a9b4d0867710e1589f1b5bed419b2e6c..d7809809413724ed3b54f7ff2f1517e1b2b7c81c 100644 (file)
@@ -1,5 +1,6 @@
 USING: sequences math mirrors splitting grouping
-kernel namespaces assocs alien.syntax columns ;
+kernel namespaces assocs alien.syntax columns
+float-arrays bit-arrays ;
 IN: benchmark.dispatch3
 
 GENERIC: g ( obj -- str )
index 4693094a15871868046ddda02d0d1cd477000037..015f762c7b97e75db60a8d8acd3b4925b59a80a0 100755 (executable)
@@ -1,7 +1,7 @@
 ! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=java&id=2
 USING: math kernel io io.files locals multiline assocs sequences
 sequences.private benchmark.reverse-complement hints io.encodings.ascii
-byte-arrays ;
+byte-arrays float-arrays ;
 IN: benchmark.fasta
 
 : IM 139968 ; inline
index b887ac4ebc6801f1acc143d1b88fdcfa049b17b4..fcba94763ff120707b9ec7ac95cad86a7c5dd43e 100755 (executable)
@@ -47,6 +47,8 @@ IN: bit-arrays.tests
     1 2 { t f t f } <slice> >bit-array
 ] unit-test
 
+[ ?{ f t } ] [ 0 2 ?{ f t f } subseq ] unit-test
+
 [ ?{ t f t f f f } ] [ 6 ?{ t f t } resize ] unit-test
 
 [ ?{ t t } ] [ 2 ?{ t t f t f t f t t t f t } resize ] unit-test
index 9d7cb117751771525240330c41987e278a697a9d..f0e4e4758601f3065f1009b541ccfcb59395573b 100755 (executable)
@@ -1,5 +1,5 @@
 USING: arrays bit-arrays help.markup help.syntax kernel\r
-bit-vectors.private combinators ;\r
+combinators ;\r
 IN: bit-vectors\r
 \r
 ARTICLE: "bit-vectors" "Bit vectors"\r
index 12bf28bdc88e866b42c71f78fe6fdd42145c6006..714c8512c19836ebe4c580200eda905ef540f2ac 100755 (executable)
@@ -1,5 +1,5 @@
 USING: arrays float-arrays help.markup help.syntax kernel\r
-float-vectors.private combinators ;\r
+combinators ;\r
 IN: float-vectors\r
 \r
 ARTICLE: "float-vectors" "Float vectors"\r
index 2b3cdff06ea23218bf1982bec8b63b7bccf38bbe..6a0ea5828e20640172233fc78066813f3def9018 100755 (executable)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: system kernel namespaces strings hashtables sequences 
 assocs combinators vocabs.loader init threads continuations
-math accessors concurrency.flags destructors inspector
+math accessors concurrency.flags destructors
 io io.backend io.timeouts io.pipes io.pipes.private io.encodings
 io.streams.duplex io.ports debugger prettyprint summary ;
 IN: io.launcher
@@ -136,7 +136,7 @@ ERROR: process-failed process code ;
 M: process-failed error.
     dup "Process exited with error code " write code>> . nl
     "Launch descriptor:" print nl
-    process>> describe ;
+    process>> . ;
 
 : try-process ( desc -- )
     run-process dup wait-for-process dup zero?
index 4171c79a0aaf1829a68362d61f3de5d28b96cb76..52caaa10c9c1bbb95c8a7f017f6febe14c9e4488 100644 (file)
@@ -1,6 +1,9 @@
 ! Copyright (C) 2007 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types colors jamshred.game jamshred.oint jamshred.player jamshred.tunnel kernel math math.constants math.functions math.vectors opengl opengl.gl opengl.glu sequences ;
+USING: accessors alien.c-types colors jamshred.game
+jamshred.oint jamshred.player jamshred.tunnel kernel math
+math.constants math.functions math.vectors opengl opengl.gl
+opengl.glu sequences float-arrays ;
 IN: jamshred.gl
 
 : min-vertices 6 ; inline
index c40729e35b0541512e08c7396d76dcf7c6481dd0..48ea847db1260212f2d32babd7b9a19dc6bf18c6 100644 (file)
@@ -1,7 +1,9 @@
 ! Copyright (C) 2007, 2008 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors colors combinators jamshred.log jamshred.oint jamshred.sound jamshred.tunnel kernel locals math math.constants math.order math.ranges math.vectors math.matrices shuffle sequences system ;
-USE: tools.walker
+USING: accessors colors combinators jamshred.log jamshred.oint
+jamshred.sound jamshred.tunnel kernel locals math math.constants
+math.order math.ranges math.vectors math.matrices shuffle
+sequences system float-arrays ;
 IN: jamshred.player
 
 TUPLE: player < oint name sounds tunnel nearest-segment last-move speed ;
index 722609851a9c4d063e2940e239a3fec5c8c2535e..97077bdd67e1bb9e5ce48ed8fb96bee390e75747 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays jamshred.oint jamshred.tunnel kernel math.vectors sequences tools.test ;
+USING: arrays jamshred.oint jamshred.tunnel kernel math.vectors sequences tools.test float-arrays ;
 IN: jamshred.tunnel.tests
 
 [ 0 ] [ T{ segment f { 0 0 0 } f f f 0 }
index 685ed71e8d2a4718690d43f5b028359960b398fa..0ba6f9abec9f7b336c2694dc94088b19069b452c 100755 (executable)
@@ -1,15 +1,15 @@
 USING: tools.deploy.config ;
 H{
-    { deploy-name "Maze" }
-    { deploy-word-props? f }
+    { deploy-reflection 1 }
+    { deploy-math? t }
     { deploy-ui? t }
-    { deploy-c-types? f }
+    { deploy-name "Maze" }
     { deploy-compiler? t }
-    { deploy-io 1 }
-    { deploy-random? t }
+    { deploy-threads? t }
     { deploy-word-defs? f }
-    { deploy-math? t }
+    { deploy-c-types? f }
+    { deploy-io 1 }
     { "stop-after-last-window?" t }
-    { deploy-reflection 1 }
-    { deploy-threads? t }
+    { deploy-random? t }
+    { deploy-word-props? f }
 }
index e534691ecd2591108991935c3b6e887e1db50b8c..90f3d1efbb7b76a8ddafb57451826a6c5cb84d65 100644 (file)
@@ -1,19 +1,14 @@
-USING: alien.c-types io io.files io.ports kernel
-namespaces random io.encodings.binary init
-accessors system ;
+USING: alien.c-types io io.files kernel namespaces random
+io.encodings.binary init accessors system ;
 IN: random.unix
 
-TUPLE: unix-random path ;
+TUPLE: unix-random reader ;
 
-C: <unix-random> unix-random
-
-: file-read-unbuffered ( n path -- bytes )
-    over default-buffer-size [
-        binary [ read ] with-file-reader
-    ] with-variable ;
+: <unix-random> ( path -- random )
+    binary <file-reader> unix-random boa ;
 
 M: unix-random random-bytes* ( n tuple -- byte-array )
-    path>> file-read-unbuffered ;
+    reader>> stream-read ;
 
 os openbsd? [
     [
index 638c91553f17429e9206692d58910e4ce0dd9011..3a75ad65b60687a7e7e85c20fac28f34f161e6c4 100755 (executable)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 ! 
 USING: tools.test kernel serialize io io.streams.byte-array math
-alien arrays byte-arrays sequences math prettyprint parser
-classes math.constants io.encodings.binary random
-assocs ;
+alien arrays byte-arrays bit-arrays float-arrays sequences math
+prettyprint parser classes math.constants io.encodings.binary
+random assocs ;
 IN: serialize.tests
 
 : test-serialize-cell
index ff4b6b7ef99b319397b27400abce9f2f9dce76d3..52c1535886fe14dde59cc0e694da100db2a9dccf 100755 (executable)
@@ -248,12 +248,6 @@ SYMBOL: deserialized
 : deserialize-byte-array ( -- byte-array )
     B{ } [ read1 ] (deserialize-seq) ;
 
-: deserialize-bit-array ( -- bit-array )
-    ?{ } [ (deserialize) ] (deserialize-seq) ;
-
-: deserialize-float-array ( -- float-array )
-    F{ } [ 8 read be> bits>double ] (deserialize-seq) ;
-
 : deserialize-hashtable ( -- hashtable )
     H{ } clone
     [ intern-object ]
@@ -284,9 +278,7 @@ SYMBOL: deserialized
             { CHAR: T [ deserialize-tuple ] }
             { CHAR: W [ deserialize-wrapper ] }
             { CHAR: a [ deserialize-array ] }
-            { CHAR: b [ deserialize-bit-array ] }
             { CHAR: c [ deserialize-complex ] }
-            { CHAR: f [ deserialize-float-array ] }
             { CHAR: h [ deserialize-hashtable ] }
             { CHAR: m [ deserialize-negative-integer ] }
             { CHAR: n [ deserialize-false ] }
index ed22902af2e3a3f1c5db057fc7e451eaa22e20d3..cbc4f4e5ac93cb6e2a7942722e67e3f4a11ffec3 100755 (executable)
@@ -34,7 +34,7 @@ namespaces continuations layouts accessors ;
 ] unit-test\r
 \r
 [ t ] [\r
-    cell 8 = 40 20 ? 100000 * small-enough?\r
+    cell 8 = 35 17 ? 100000 * small-enough?\r
 ] unit-test\r
 \r
 [ ] [ "maze" shake-and-bake ] unit-test\r
index ade49a26f46700da250e8c10d6842983003718d6..05bf3c964227c4bd40b4094590054fe92e296377 100755 (executable)
@@ -25,8 +25,11 @@ QUALIFIED: threads
 QUALIFIED: vocabs
 IN: tools.deploy.shaker
 
+! This file is some hairy shit.
+
 : strip-init-hooks ( -- )
     "Stripping startup hooks" show
+    "cpu.x86" init-hooks get delete-at
     "command-line" init-hooks get delete-at
     "libc" init-hooks get delete-at
     deploy-threads? get [
@@ -69,13 +72,15 @@ IN: tools.deploy.shaker
     [ "no-def-strip" word-prop not ] filter
     [ [ ] >>def drop ] each ;
 
+: sift-assoc ( assoc -- assoc' ) [ nip ] assoc-filter ;
+
 : strip-word-props ( stripped-props words -- )
     "Stripping word properties" show
     [
         [
             props>> swap
             '[ drop , member? not ] assoc-filter
-            f assoc-like
+            sift-assoc f assoc-like
         ] keep (>>props)
     ] with each ;
 
@@ -255,6 +260,7 @@ IN: tools.deploy.shaker
         global swap
         '[ drop , member? not ] assoc-filter
         [ drop string? not ] assoc-filter ! strip CLI args
+        sift-assoc
         dup keys unparse show
         21 setenv
     ] [ drop ] if ;
index 0c77a52f94bb0209197ffc3b4afbb3de5e0c30a3..de5aee68e20aff79e0a7ef056a24e20a598dfe65 100755 (executable)
@@ -21,6 +21,9 @@ global [
     sent-messages off
     super-sent-messages off
 
+    alien>objc-types off
+    objc>alien-types off
+
     ! We need this for strip-stack-traces to work fully
     { message-senders super-message-senders }
     [ get values compile ] each
index 41218df425c9566db3157c5aba8b2a03cfc5b38e..fd1ee0f5736d18bd2c388caf6d73304df3e2664d 100755 (executable)
@@ -2,7 +2,8 @@ IN: ui.gadgets.panes.tests
 USING: alien ui.gadgets.panes ui.gadgets namespaces
 kernel sequences io io.styles io.streams.string tools.test
 prettyprint definitions help help.syntax help.markup
-help.stylesheet splitting tools.test.ui models math summary ;
+help.stylesheet splitting tools.test.ui models math summary
+inspector ;
 
 : #children "pane" get gadget-children length ;
 
index 66cebd5663e316782fa3a71e83771051519d2759..88bc2bcee73d22c9f56a9bf13890e4d72dc10df5 100755 (executable)
@@ -192,7 +192,7 @@ SYMBOL: drag-timer
     dup hand-last-button get = ;
 
 : multi-click-position? ( -- ? )
-    hand-loc get hand-click-loc get v- norm 10 <= ;
+    hand-loc get hand-click-loc get v- norm-sq 100 <= ;
 
 : multi-click? ( button -- ? )
     {