From aeb2b9d701eb8972a667bc8c5ccedf6111e0d37b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 2 Jul 2008 15:57:38 -0500 Subject: [PATCH] Fixing unit test failures --- core/alien/alien-tests.factor | 2 - core/assocs/assocs-tests.factor | 2 +- core/bit-arrays/authors.txt | 1 - core/bit-arrays/bit-arrays-docs.factor | 62 ---------------- core/bit-arrays/bit-arrays-tests.factor | 74 ------------------- core/bit-arrays/bit-arrays.factor | 67 ----------------- core/bit-arrays/summary.txt | 1 - core/bit-arrays/tags.txt | 1 - core/classes/tuple/tuple-tests.factor | 2 +- core/compiler/tests/intrinsics.factor | 4 +- core/float-arrays/authors.txt | 1 - core/float-arrays/float-arrays-docs.factor | 54 -------------- core/float-arrays/float-arrays-tests.factor | 10 --- core/float-arrays/float-arrays.factor | 43 ----------- core/float-arrays/summary.txt | 1 - core/float-arrays/tags.txt | 1 - core/inference/class/class-tests.factor | 15 +++- core/sequences/sequences-tests.factor | 2 - extra/benchmark/dispatch2/dispatch2.factor | 2 +- extra/benchmark/dispatch3/dispatch3.factor | 3 +- extra/benchmark/fasta/fasta.factor | 2 +- extra/bit-arrays/bit-arrays-tests.factor | 2 + extra/bit-vectors/bit-vectors-docs.factor | 2 +- extra/float-vectors/float-vectors-docs.factor | 2 +- extra/io/launcher/launcher.factor | 4 +- extra/jamshred/gl/gl.factor | 5 +- extra/jamshred/player/player.factor | 6 +- extra/jamshred/tunnel/tunnel-tests.factor | 2 +- extra/maze/deploy.factor | 16 ++-- extra/random/unix/unix.factor | 17 ++--- extra/serialize/serialize-tests.factor | 6 +- extra/serialize/serialize.factor | 8 -- extra/tools/deploy/deploy-tests.factor | 2 +- extra/tools/deploy/shaker/shaker.factor | 8 +- extra/tools/deploy/shaker/strip-cocoa.factor | 3 + extra/ui/gadgets/panes/panes-tests.factor | 3 +- extra/ui/gestures/gestures.factor | 2 +- 37 files changed, 66 insertions(+), 372 deletions(-) delete mode 100644 core/bit-arrays/authors.txt delete mode 100644 core/bit-arrays/bit-arrays-docs.factor delete mode 100755 core/bit-arrays/bit-arrays-tests.factor delete mode 100755 core/bit-arrays/bit-arrays.factor delete mode 100644 core/bit-arrays/summary.txt delete mode 100644 core/bit-arrays/tags.txt delete mode 100755 core/float-arrays/authors.txt delete mode 100644 core/float-arrays/float-arrays-docs.factor delete mode 100755 core/float-arrays/float-arrays-tests.factor delete mode 100755 core/float-arrays/float-arrays.factor delete mode 100644 core/float-arrays/summary.txt delete mode 100644 core/float-arrays/tags.txt diff --git a/core/alien/alien-tests.factor b/core/alien/alien-tests.factor index 28a1e98710..9be2885888 100755 --- a/core/alien/alien-tests.factor +++ b/core/alien/alien-tests.factor @@ -58,8 +58,6 @@ cell 8 = [ [ "ALIEN: 1234" ] [ 1234 unparse ] unit-test [ ] [ 0 B{ 1 2 3 } drop ] unit-test -[ ] [ 0 F{ 1 2 3 } drop ] unit-test -[ ] [ 0 ?{ t f t } drop ] unit-test [ 0 B{ 1 2 3 } alien-address ] must-fail diff --git a/core/assocs/assocs-tests.factor b/core/assocs/assocs-tests.factor index 43a1bac82d..4a44dbd641 100755 --- a/core/assocs/assocs-tests.factor +++ b/core/assocs/assocs-tests.factor @@ -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 index 1901f27a24..0000000000 --- a/core/bit-arrays/authors.txt +++ /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 index 6f3afe0867..0000000000 --- a/core/bit-arrays/bit-arrays-docs.factor +++ /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 } -"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: ( 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 index b41cf9c4a5..0000000000 --- a/core/bit-arrays/bit-arrays-tests.factor +++ /dev/null @@ -1,74 +0,0 @@ -USING: sequences arrays bit-arrays kernel tools.test math -random ; -IN: bit-arrays.tests - -[ 100 ] [ 100 length ] unit-test - -[ - { t f t } -] [ - 3 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 } >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 index 4446bb5556..0000000000 --- a/core/bit-arrays/bit-arrays.factor +++ /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 - -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 ; - -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+ 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 index 8844bfc933..0000000000 --- a/core/bit-arrays/summary.txt +++ /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 index 42d711b32b..0000000000 --- a/core/bit-arrays/tags.txt +++ /dev/null @@ -1 +0,0 @@ -collections diff --git a/core/classes/tuple/tuple-tests.factor b/core/classes/tuple/tuple-tests.factor index 43a70faa6c..c2bd10b68a 100755 --- a/core/classes/tuple/tuple-tests.factor +++ b/core/classes/tuple/tuple-tests.factor @@ -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 diff --git a/core/compiler/tests/intrinsics.factor b/core/compiler/tests/intrinsics.factor index 4ae48c09b4..42becc5588 100755 --- a/core/compiler/tests/intrinsics.factor +++ b/core/compiler/tests/intrinsics.factor @@ -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 index 1901f27a24..0000000000 --- a/core/float-arrays/authors.txt +++ /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 index cb36aade6b..0000000000 --- a/core/float-arrays/float-arrays-docs.factor +++ /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 } -"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: ( 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 index 0918eecd84..0000000000 --- a/core/float-arrays/float-arrays-tests.factor +++ /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 ] 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 index d25d447a46..0000000000 --- a/core/float-arrays/float-arrays.factor +++ /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 - -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 ; - -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 ; 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 index 0eac3b0b1a..0000000000 --- a/core/float-arrays/summary.txt +++ /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 index 42d711b32b..0000000000 --- a/core/float-arrays/tags.txt +++ /dev/null @@ -1 +0,0 @@ -collections diff --git a/core/inference/class/class-tests.factor b/core/inference/class/class-tests.factor index ba1e3d89a3..591baf1287 100755 --- a/core/inference/class/class-tests.factor +++ b/core/inference/class/class-tests.factor @@ -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 } ; diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index b500f69045..a12184690d 100755 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -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 diff --git a/extra/benchmark/dispatch2/dispatch2.factor b/extra/benchmark/dispatch2/dispatch2.factor index 4e4d3f8bd5..7145cd94f7 100644 --- a/extra/benchmark/dispatch2/dispatch2.factor +++ b/extra/benchmark/dispatch2/dispatch2.factor @@ -1,5 +1,5 @@ USING: namespaces math sequences splitting grouping -kernel columns ; +kernel columns float-arrays bit-arrays ; IN: benchmark.dispatch2 : sequences ( -- seq ) diff --git a/extra/benchmark/dispatch3/dispatch3.factor b/extra/benchmark/dispatch3/dispatch3.factor index 4e4712a1a9..d780980941 100644 --- a/extra/benchmark/dispatch3/dispatch3.factor +++ b/extra/benchmark/dispatch3/dispatch3.factor @@ -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 ) diff --git a/extra/benchmark/fasta/fasta.factor b/extra/benchmark/fasta/fasta.factor index 4693094a15..015f762c7b 100755 --- a/extra/benchmark/fasta/fasta.factor +++ b/extra/benchmark/fasta/fasta.factor @@ -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 diff --git a/extra/bit-arrays/bit-arrays-tests.factor b/extra/bit-arrays/bit-arrays-tests.factor index b887ac4ebc..fcba94763f 100755 --- a/extra/bit-arrays/bit-arrays-tests.factor +++ b/extra/bit-arrays/bit-arrays-tests.factor @@ -47,6 +47,8 @@ IN: bit-arrays.tests 1 2 { t f t f } >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 diff --git a/extra/bit-vectors/bit-vectors-docs.factor b/extra/bit-vectors/bit-vectors-docs.factor index 9d7cb11775..f0e4e47586 100755 --- a/extra/bit-vectors/bit-vectors-docs.factor +++ b/extra/bit-vectors/bit-vectors-docs.factor @@ -1,5 +1,5 @@ USING: arrays bit-arrays help.markup help.syntax kernel -bit-vectors.private combinators ; +combinators ; IN: bit-vectors ARTICLE: "bit-vectors" "Bit vectors" diff --git a/extra/float-vectors/float-vectors-docs.factor b/extra/float-vectors/float-vectors-docs.factor index 12bf28bdc8..714c8512c1 100755 --- a/extra/float-vectors/float-vectors-docs.factor +++ b/extra/float-vectors/float-vectors-docs.factor @@ -1,5 +1,5 @@ USING: arrays float-arrays help.markup help.syntax kernel -float-vectors.private combinators ; +combinators ; IN: float-vectors ARTICLE: "float-vectors" "Float vectors" diff --git a/extra/io/launcher/launcher.factor b/extra/io/launcher/launcher.factor index 2b3cdff06e..6a0ea5828e 100755 --- a/extra/io/launcher/launcher.factor +++ b/extra/io/launcher/launcher.factor @@ -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? diff --git a/extra/jamshred/gl/gl.factor b/extra/jamshred/gl/gl.factor index 4171c79a0a..52caaa10c9 100644 --- a/extra/jamshred/gl/gl.factor +++ b/extra/jamshred/gl/gl.factor @@ -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 diff --git a/extra/jamshred/player/player.factor b/extra/jamshred/player/player.factor index c40729e35b..48ea847db1 100644 --- a/extra/jamshred/player/player.factor +++ b/extra/jamshred/player/player.factor @@ -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 ; diff --git a/extra/jamshred/tunnel/tunnel-tests.factor b/extra/jamshred/tunnel/tunnel-tests.factor index 722609851a..97077bdd67 100644 --- a/extra/jamshred/tunnel/tunnel-tests.factor +++ b/extra/jamshred/tunnel/tunnel-tests.factor @@ -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 } diff --git a/extra/maze/deploy.factor b/extra/maze/deploy.factor index 685ed71e8d..0ba6f9abec 100755 --- a/extra/maze/deploy.factor +++ b/extra/maze/deploy.factor @@ -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 } } diff --git a/extra/random/unix/unix.factor b/extra/random/unix/unix.factor index e534691ecd..90f3d1efbb 100644 --- a/extra/random/unix/unix.factor +++ b/extra/random/unix/unix.factor @@ -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 - -: file-read-unbuffered ( n path -- bytes ) - over default-buffer-size [ - binary [ read ] with-file-reader - ] with-variable ; +: ( path -- random ) + binary unix-random boa ; M: unix-random random-bytes* ( n tuple -- byte-array ) - path>> file-read-unbuffered ; + reader>> stream-read ; os openbsd? [ [ diff --git a/extra/serialize/serialize-tests.factor b/extra/serialize/serialize-tests.factor index 638c91553f..3a75ad65b6 100755 --- a/extra/serialize/serialize-tests.factor +++ b/extra/serialize/serialize-tests.factor @@ -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 diff --git a/extra/serialize/serialize.factor b/extra/serialize/serialize.factor index ff4b6b7ef9..52c1535886 100755 --- a/extra/serialize/serialize.factor +++ b/extra/serialize/serialize.factor @@ -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 ] } diff --git a/extra/tools/deploy/deploy-tests.factor b/extra/tools/deploy/deploy-tests.factor index ed22902af2..cbc4f4e5ac 100755 --- a/extra/tools/deploy/deploy-tests.factor +++ b/extra/tools/deploy/deploy-tests.factor @@ -34,7 +34,7 @@ namespaces continuations layouts accessors ; ] unit-test [ t ] [ - cell 8 = 40 20 ? 100000 * small-enough? + cell 8 = 35 17 ? 100000 * small-enough? ] unit-test [ ] [ "maze" shake-and-bake ] unit-test diff --git a/extra/tools/deploy/shaker/shaker.factor b/extra/tools/deploy/shaker/shaker.factor index ade49a26f4..05bf3c9642 100755 --- a/extra/tools/deploy/shaker/shaker.factor +++ b/extra/tools/deploy/shaker/shaker.factor @@ -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 ; diff --git a/extra/tools/deploy/shaker/strip-cocoa.factor b/extra/tools/deploy/shaker/strip-cocoa.factor index 0c77a52f94..de5aee68e2 100755 --- a/extra/tools/deploy/shaker/strip-cocoa.factor +++ b/extra/tools/deploy/shaker/strip-cocoa.factor @@ -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 diff --git a/extra/ui/gadgets/panes/panes-tests.factor b/extra/ui/gadgets/panes/panes-tests.factor index 41218df425..fd1ee0f573 100755 --- a/extra/ui/gadgets/panes/panes-tests.factor +++ b/extra/ui/gadgets/panes/panes-tests.factor @@ -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 ; diff --git a/extra/ui/gestures/gestures.factor b/extra/ui/gestures/gestures.factor index 66cebd5663..88bc2bcee7 100755 --- a/extra/ui/gestures/gestures.factor +++ b/extra/ui/gestures/gestures.factor @@ -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 -- ? ) { -- 2.34.1