]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: qualifying blank?, random fixes, renamed test file
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 20 Dec 2021 23:26:05 +0000 (17:26 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 20 Dec 2021 23:26:42 +0000 (17:26 -0600)
30 files changed:
basis/alien/libraries/finder/linux/linux.factor
basis/bootstrap/image/upload/upload.factor
basis/colors/constants/constants.factor
basis/csv/csv.factor
basis/db/postgresql/lib/lib.factor
basis/documents/elements/elements.factor
basis/etc-hosts/etc-hosts.factor
basis/help/apropos/apropos.factor
basis/help/syntax/syntax.factor
basis/html/templates/chloe/chloe-tests.factor
basis/http/client/client-tests.factor
basis/http/client/client.factor
basis/http/server/server-tests.factor
basis/io/launcher/windows/windows-tests.factor
basis/io/pipes/unix/pipes-tests.factor [deleted file]
basis/io/pipes/unix/unix-tests.factor [new file with mode: 0644]
core/classes/mixin/mixin-tests.factor
core/classes/tuple/parser/parser-tests.factor
core/parser/parser-tests.factor
core/splitting/splitting-docs.factor
extra/brainfuck/brainfuck-tests.factor
extra/combinators/extras/extras-tests.factor
extra/modern/modern.factor
extra/pcre/ffi/ffi-tests.factor
extra/robots/robots.factor
extra/sequences/extras/extras-tests.factor
extra/splitting/extras/extras-tests.factor
extra/text-analysis/text-analysis.factor
extra/txon/txon.factor
extra/webapps/help/help.factor

index e2dfc3965d63f2f81e42f38bc68bb91a41b0557b..528e8771f933853ede17c5930558b014361ea36c 100644 (file)
@@ -16,10 +16,10 @@ CONSTANT: mach-map {
 
 : parse-ldconfig-lines ( string -- triple )
     [
-        "=>" split1 [ [ blank? ] trim ] bi@
+        "=>" split1 [ [ unicode:blank? ] trim ] bi@
         [
             " " split1 [ "()" in? ] trim "," split
-            [ [ blank? ] trim ] map
+            [ [ unicode:blank? ] trim ] map
             [ ": Linux" swap subseq? ] reject
         ] dip 3array
     ] map ;
index 63fb72e75c8925091c7d2444b607d1366918746a..90a887dde2eac1106671d0e6ee6ae6a0d283e0d7 100644 (file)
@@ -24,7 +24,7 @@ SYMBOL: build-images-destination
     image-path parent-directory [
         { "git" "rev-parse" "--abbrev-ref" "HEAD" }
         utf8 <process-reader> stream-contents
-        [ blank? ] trim-tail
+        [ unicode:blank? ] trim-tail
     ] with-directory ;
 
 : git-branch-destination ( -- dest )
index 9be352ca47d6f118ccb7ef31574ba3b70e9a62f6..0fc48c295b83e0ea679da55a8900c15cd9ae8700 100644 (file)
@@ -9,7 +9,7 @@ IN: colors.constants
 : parse-color ( line -- name color )
     first4
     [ [ string>number 255 /f ] tri@ 1.0 <rgba> ] dip
-    [ blank? ] trim-head H{ { CHAR: \s CHAR: - } } substitute swap ;
+    [ ascii:blank? ] trim-head H{ { CHAR: \s CHAR: - } } substitute swap ;
 
 : parse-colors ( lines -- assoc )
     [ "!" head? ] reject
index bf42a0a6eb24c1316eac2c9daeb330d7eb9b9c37..a4f6ab61ddf1c3e4360934c9b5769ee77d467821 100644 (file)
@@ -35,9 +35,9 @@ DEFER: quoted-field,
 
 : ?trim ( string -- string' )
     dup length [ drop "" ] [
-        over first-unsafe blank?
-        [ drop t ] [ 1 - over nth-unsafe blank? ] if
-        [ [ blank? ] trim ] when
+        over first-unsafe unicode:blank?
+        [ drop t ] [ 1 - over nth-unsafe unicode:blank? ] if
+        [ [ unicode:blank? ] trim ] when
     ] if-zero ; inline
 
 : continue-field ( delimiter stream field-seps seq -- sep/f field )
index f1c5d1e47c3093ed86cad965703aa07f0b3227b1..ebbc85dec3c4823641546da12cd9dc54417425c1 100644 (file)
@@ -13,7 +13,7 @@ IN: db.postgresql.lib
     dup zero? [
         drop f
     ] [
-        PQresultErrorMessage [ blank? ] trim
+        PQresultErrorMessage [ ascii:blank? ] trim
     ] if ;
 
 : postgres-result-error ( res -- )
@@ -21,7 +21,7 @@ IN: db.postgresql.lib
 
 : (postgresql-error-message) ( handle -- str )
     PQerrorMessage
-    "\n" split [ [ blank? ] trim ] map join-lines ;
+    "\n" split [ [ ascii:blank? ] trim ] map join-lines ;
 
 : postgresql-error-message ( -- str )
     db-connection get handle>> (postgresql-error-message) ;
index 853a6e1f14a5ca246e874104070f62af34e571a5..438016747492d2d9ff761fb23d9e00100cba75a0 100644 (file)
@@ -56,10 +56,10 @@ M: one-char-elt next-elt 2drop ;
 <PRIVATE
 
 : blank-at? ( n seq -- n seq ? )
-    2dup ?nth blank? ;
+    2dup ?nth unicode:blank? ;
 
 : break-detector ( ? -- quot )
-    '[ blank? _ xor ] ; inline
+    '[ unicode:blank? _ xor ] ; inline
 
 : prev-word ( col str ? -- col )
     break-detector find-last-from drop ?1+ ;
index 4e102bba1d6e930949327e2971ad39d3af955041..351bcdf241330273bd771cf01f5015e95485016c 100644 (file)
@@ -13,11 +13,11 @@ M: unix hosts-path "/etc/hosts" ;
 
 : parse-hosts ( path -- hosts )
     utf8 file-lines
-    [ [ blank? ] trim ] map harvest
+    [ [ unicode:blank? ] trim ] map harvest
     [ "#" head? ] reject
     [
-        [ blank? ] split1-when
-        [ blank? ] split-when harvest
+        [ unicode:blank? ] split1-when
+        [ unicode:blank? ] split-when harvest
     ] H{ } map>assoc ;
 
 MEMO: system-hosts ( -- hosts ) hosts-path parse-hosts ;
index 1e79727130b2692287f1e0355a9c863ebfac9aed..49e9e2947f22aa2ce5f6a9b23082bfa60bdfcd09 100644 (file)
@@ -89,4 +89,4 @@ M: apropos-search >link ;
 INSTANCE: apropos-search topic
 
 : apropos ( str -- )
-    [ blank? ] trim <apropos-search> print-topic ;
+    [ unicode:blank? ] trim <apropos-search> print-topic ;
index fc809078b0789ff805971255231f29910cf04d8b..0888be585022e45b3ad2f3de2a4383cd859c2272 100644 (file)
@@ -79,7 +79,7 @@ IN: help.syntax
     ] produce nip ;
 
 : code-lines ( str -- seq )
-    split-lines [ [ blank? ] trim ] map harvest ;
+    split-lines [ [ ascii:blank? ] trim ] map harvest ;
 
 : make-example ( str -- seq )
     code-lines dup { [ array? ] [ length 1 > ] } 1&& [
index 2a205f929f5c83c15fcc971ab8d102e847b5ece6..2fce6ac8da00172d1e9b7a5dc41693631c80ad8d 100644 (file)
@@ -97,7 +97,7 @@ M: link-test link-href drop "http://www.apple.com/foo&bar" ;
 { "<ul><li>1</li><li>2</li><li>3</li></ul>" } [
     [
         "test7" test-template call-template
-    ] run-template [ blank? ] reject
+    ] run-template [ ascii:blank? ] reject
 ] unit-test
 
 TUPLE: person first-name last-name ;
@@ -112,7 +112,7 @@ TUPLE: person first-name last-name ;
 { "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" } [
     [
         "test8" test-template call-template
-    ] run-template [ blank? ] reject
+    ] run-template [ ascii:blank? ] reject
 ] unit-test
 
 { } [
@@ -125,7 +125,7 @@ TUPLE: person first-name last-name ;
 { "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" } [
     [
         "test8" test-template call-template
-    ] run-template [ blank? ] reject
+    ] run-template [ ascii:blank? ] reject
 ] unit-test
 
 { } [ 1 "id" set-value ] unit-test
@@ -153,7 +153,7 @@ TUPLE: person first-name last-name ;
 { "<table><tr><td>RBaxter</td><td>Unknown</td></tr></table>" } [
     [
         "test11" test-template call-template
-    ] run-template [ blank? ] reject
+    ] run-template [ ascii:blank? ] reject
 ] unit-test
 
 { } [
index bb9c64fc47d7c9e5292d6d425ce5c10912c3fb1f..d139ad7b6ad3f79a5323ae6f407a95f8f1d3db0f 100644 (file)
@@ -1,5 +1,6 @@
 USING: accessors http http.client http.client.private
-io.streams.string kernel namespaces sequences tools.test urls ;
+io.streams.string kernel namespaces sequences splitting
+tools.test urls ;
 IN: http.client.tests
 
 { "foo.txt" } [ "http://www.paulgraham.com/foo.txt" download-name ] unit-test
index 14077dc6239d4e66dc12397da1d85771d80d5ecd..b0bad5ff61ea2a61dfbed85dcb77747d1188a78b 100644 (file)
@@ -1,13 +1,13 @@
 ! Copyright (C) 2005, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors ascii assocs calendar combinators.short-circuit
-destructors fry hashtables http http.client.post-data
-http.parsers io io.crlf io.encodings io.encodings.ascii
-io.encodings.binary io.encodings.iana io.encodings.string
-io.files io.pathnames io.sockets io.sockets.secure io.timeouts
-kernel locals math math.order math.parser mime.types namespaces
-present sequences splitting urls vocabs.loader combinators
-environment ;
+USING: accessors ascii assocs calendar combinators
+combinators.short-circuit destructors environment hashtables
+http http.client.post-data http.parsers io io.crlf io.encodings
+io.encodings.ascii io.encodings.binary io.encodings.iana
+io.encodings.string io.files io.pathnames io.sockets
+io.sockets.secure io.timeouts kernel math math.order math.parser
+mime.types namespaces present sequences splitting urls
+vocabs.loader ;
 IN: http.client
 
 ERROR: too-many-redirects ;
index e6d4c211544cc8492ce4f5138eccc4b19b37046e..0cafe546e3ef2f4d3dab9ea12dcd0f09981d88b4 100644 (file)
@@ -1,6 +1,7 @@
 USING: accessors assocs continuations http http.server
 http.server.requests io.encodings.utf8 io.encodings.binary
-io.streams.string kernel math peg sequences tools.test urls ;
+io.streams.string kernel math peg sequences tools.test urls
+splitting ;
 
 { t } [ [ \ + first ] [ <500> ] recover response? ] unit-test
 
index 08d3bb6e2c06a2e08ac7fc6866ee6efa3d9bdd6c..c0a3795798e2af6c935deed2ac96d1b23207a63f 100644 (file)
@@ -97,7 +97,7 @@ SYMBOLS: out-path err-path ;
         console-vm-path "-run=listener" 2array >>command
         +closed+ >>stdin
         +stdout+ >>stderr
-    utf8 [ lines last ] with-process-reader
+    utf8 [ read-lines last ] with-process-reader
 ] unit-test
 
 : launcher-test-path ( -- str )
@@ -231,7 +231,7 @@ SYMBOLS: out-path err-path ;
 
 [ "IN: scratchpad " ] [
     console-vm-path "-run=listener" 2array
-    ascii [ "USE: system 0 exit" print flush lines last ] with-process-stream
+    ascii [ "USE: system 0 exit" print flush read-lines last ] with-process-stream
 ] unit-test
 
 [ ] [
diff --git a/basis/io/pipes/unix/pipes-tests.factor b/basis/io/pipes/unix/pipes-tests.factor
deleted file mode 100644 (file)
index 7d5a660..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-USING: tools.test io.pipes io.pipes.unix io.encodings.utf8
-io.encodings io namespaces sequences ;
-
-[ { 0 0 } ] [ { "ls" "grep ." } run-pipeline ] unit-test
-
-[ { 0 f 0 } ] [
-    {
-        "ls"
-        [
-            input-stream [ utf8 <decoder> ] change
-            output-stream [ utf8 <encoder> ] change
-            input-stream get lines reverse [ print ] each f
-        ]
-        "grep ."
-    } run-pipeline
-] unit-test
diff --git a/basis/io/pipes/unix/unix-tests.factor b/basis/io/pipes/unix/unix-tests.factor
new file mode 100644 (file)
index 0000000..b0d1f36
--- /dev/null
@@ -0,0 +1,16 @@
+USING: tools.test io.pipes io.pipes.unix io.encodings.utf8
+io.encodings io namespaces sequences splitting ;
+
+[ { 0 0 } ] [ { "ls" "grep ." } run-pipeline ] unit-test
+
+[ { 0 f 0 } ] [
+    {
+        "ls"
+        [
+            input-stream [ utf8 <decoder> ] change
+            output-stream [ utf8 <encoder> ] change
+            input-stream get stream-contents split-lines reverse [ print ] each f
+        ]
+        "grep ."
+    } run-pipeline
+] unit-test
index 6ed0003f648428a91c387bb01dafd1dd262d1563..ec7c7fb4ec8aa4e4b7fe9e870e78b23cc60f37f8 100644 (file)
@@ -1,7 +1,7 @@
 USING: accessors arrays assocs classes classes.algebra classes.mixin
 classes.mixin.private classes.union.private compiler.units definitions
-eval hashtables kernel math parser sequences source-files strings
-tools.test vectors words ;
+eval hashtables kernel math parser sequences source-files splitting
+strings tools.test vectors words ;
 IN: classes.mixin.tests
 
 ! Test mixins
index 2f948cd69fd2d8ffd5aeb1bc712b188f8048e051..35ad96c756312e769408964d4815ac646cfe99d0 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors classes.tuple.parser lexer words classes
 sequences math kernel slots tools.test parser compiler.units
-arrays classes.tuple eval multiline ;
+arrays classes.tuple eval multiline splitting ;
 IN: classes.tuple.parser.tests
 
 TUPLE: test-1 ;
index 53981abc1b31e46cdc587cb93f93aa2b6bb27f7e..0cddf9026a96ce085bd4fce0a0f0490550c6b57a 100644 (file)
@@ -2,7 +2,7 @@ USING: accessors arrays assocs classes compiler.units effects
 eval generic grouping io.pathnames io.streams.string kernel
 lexer math multiline namespaces parser sequences sets
 source-files source-files.errors strings tools.crossref
-tools.test vocabs vocabs.parser words words.symbol ;
+tools.test vocabs vocabs.parser words words.symbol splitting ;
 IN: parser.tests
 
 { 1 [ 2 [ 3 ] 4 ] 5 }
index 51bad5472baf4db9b59bd4e83dc143b74547608a..f291372f7a6a4ce90248fbf39d3a37772508b2e0 100644 (file)
@@ -98,7 +98,7 @@ HELP: split-lines
 { $values { "seq" sequence } { "seq'" { $sequence string } } }
 { $description "Splits a string along line breaks." }
 { $examples
-    { $example "USING: prettyprint splitting ;" "\"Hello\\r\\nworld\\n\" lines ." "{ \"Hello\" \"world\" }" }
+    { $example "USING: prettyprint splitting ;" "\"Hello\\r\\nworld\\n\" split-lines ." "{ \"Hello\" \"world\" }" }
 } ;
 
 HELP: replace
index 92de4d0267546e2dd09ad44ac21110e9f4315b9a..3cf8fb882ba924efabd178f5c5842593de62e0aa 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license
 
 USING: brainfuck io.streams.string kernel literals math
-math.parser math.ranges sequences tools.test ;
+math.parser math.ranges sequences splitting tools.test ;
 
 [ "+" run-brainfuck ] must-infer
 [ "+" get-brainfuck ] must-infer
index 5f1bdee9b7e9bebd191883cc2099bfec28894370..2c63ea5cc631616addd9054bbda2696fe88a52d3 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2013 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs combinators.extras io.files kernel math sequences
-splitting tools.test ;
+splitting tools.test splitting ;
 
 { "a b" }
 [ "a" "b" [ " " glue ] once ] unit-test
@@ -66,5 +66,5 @@ splitting tools.test ;
 { f } [ H{ { 1 H{ { 3 4 } } } } { [ 1 of ] [ 2 of ] } chain ] unit-test
 { f } [ H{ { 2 H{ { 3 4 } } } } { [ 1 of ] [ 2 of ] } chain ] unit-test
 { 5 } [
-    "hello factor!" { [ words ] [ first ] [ length ] } chain
+    "hello factor!" { [ split-words ] [ first ] [ length ] } chain
 ] unit-test
index 4c86e8cf6ccfc45d6109f508a0f7074f6cbd3152..e26d09e306bb35ae6753412525492d12c790b2b4 100644 (file)
@@ -99,7 +99,7 @@ MACRO:: read-matched ( ch -- quot: ( n string tag -- n' string slice' ) )
         n string tag
         2over nth-check-eof {
             { [ dup openstreq member? ] [ ch read-double-matched ] } ! (=( or ((
-            { [ dup blank? ] [
+            { [ dup unicode:blank? ] [
                 drop dup '[ _ matching-delimiter-string closestr1 2array members lex-until ] dip
                 swap unclip-last 3array ] } ! ( foo )
             [ drop [ slice-til-whitespace drop ] dip span-slices ]  ! (foo)
@@ -185,7 +185,7 @@ ERROR: unexpected-terminator n string slice ;
         [ "<" head? ]
         [ length 2 >= ]
         [ rest strict-upper? not ]
-        [ [ blank? ] any? not ]
+        [ [ unicode:blank? ] any? not ]
         [ "/>" tail? ]
     } 1&& ;
 
@@ -195,7 +195,7 @@ ERROR: unexpected-terminator n string slice ;
         [ length 2 >= ]
         [ second CHAR: / = not ]
         [ rest strict-upper? not ]
-        [ [ blank? ] any? not ]
+        [ [ unicode:blank? ] any? not ]
         [ ">" tail? ]
     } 1&& ;
 
@@ -205,7 +205,7 @@ ERROR: unexpected-terminator n string slice ;
         [ length 2 >= ]
         [ second CHAR: / = not ]
         [ rest strict-upper? not ]
-        [ [ blank? ] any? not ]
+        [ [ unicode:blank? ] any? not ]
         [ ">" tail? not ]
     } 1&& ;
 
@@ -214,7 +214,7 @@ ERROR: unexpected-terminator n string slice ;
         [ "</" head? ]
         [ length 2 >= ]
         [ rest strict-upper? not ]
-        [ [ blank? ] any? not ]
+        [ [ unicode:blank? ] any? not ]
         [ ">" tail? ]
     } 1&& ;
 
@@ -451,7 +451,7 @@ ERROR: compound-syntax-disallowed n seq obj ;
 
 : check-compound-loop ( n/f string -- n/f string ? )
     [ ] [ peek1-from ] [ previous-from ] 2tri
-    [ blank? ] bi@ or not ! no blanks between tokens
+    [ unicode:blank? ] bi@ or not ! no blanks between tokens
     pick and ; ! and a valid index
 
 : lex-factor ( n/f string/f -- n'/f string literal/f )
index d3b71c569f380846ecce3a407d1798abb66280b1..bcea5cb7d3e3cec83c9df4031d41ec1450d1ef64 100644 (file)
@@ -1,4 +1,4 @@
 USING: pcre.ffi sequences splitting tools.test ;
 IN: pcre.ffi.tests
 
-{ 2 } [ pcre_version words length ] unit-test
+{ 2 } [ pcre_version split-words length ] unit-test
index defb520f9c4cb5c3bfe1eac0a331b6559c72bef4..3df4f14ad42864ffff23f20f9e96d91e4d06b7a2 100644 (file)
@@ -33,9 +33,9 @@ visit-time request-rate crawl-delay unknowns ;
 
 : normalize-robots.txt ( string -- sitemaps seq )
     split-lines
-    [ [ blank? ] trim ] map
+    [ [ unicode:blank? ] trim ] map
     [ "#" head? ] reject harvest
-    [ ":" split1 [ [ blank? ] trim ] bi@ [ >lower ] dip  ] { } map>assoc
+    [ ":" split1 [ [ unicode:blank? ] trim ] bi@ [ >lower ] dip  ] { } map>assoc
     [ first "sitemap" = ] partition [ values ] dip
     [
         {
index f4ede8fb2461113a0d9827044cc6d234b45adafc..edad8b5a4d13af723874780a4b7f2aa5d829ebf8 100644 (file)
@@ -54,13 +54,13 @@ tools.test vectors vocabs ;
 { { 2 4 6 } } [ { 1 2 3 4 5 6 } odd-indices ] unit-test
 
 { "a b c d e" }
-[ "a      b  \t \n \r  c   d \n    e   " [ blank? ] " " compact ] unit-test
+[ "a      b  \t \n \r  c   d \n    e   " [ ascii:blank? ] " " compact ] unit-test
 
 { " a b c d e " }
-[ " a      b  c   d    e   " [ blank? ] " " collapse ] unit-test
+[ " a      b  c   d    e   " [ ascii:blank? ] " " collapse ] unit-test
 
 { { "hello," " " "world!" " " " " } }
-[ "hello, world!  " [ blank? ] slice-when [ >string ] map ] unit-test
+[ "hello, world!  " [ ascii:blank? ] slice-when [ >string ] map ] unit-test
 
 { t }
 [ "abc" sequence>slice slice? ] unit-test
@@ -123,15 +123,15 @@ tools.test vectors vocabs ;
 { "ADEBFC" } [ { "ABC" "D" "EF" } round-robin >string ] unit-test
 
 { { } } [ "ABC" [ ] { } trim-as ] unit-test
-{ "ABC" } [ { 32 65 66 67 32 } [ blank? ] "" trim-as ] unit-test
+{ "ABC" } [ { 32 65 66 67 32 } [ ascii:blank? ] "" trim-as ] unit-test
 
-{ t } [ "ABC" dup [ blank? ] ?trim [ identity-hashcode ] same? ] unit-test
-{ "ABC" } [ " ABC " [ blank? ] ?trim ] unit-test
+{ t } [ "ABC" dup [ ascii:blank? ] ?trim [ identity-hashcode ] same? ] unit-test
+{ "ABC" } [ " ABC " [ ascii:blank? ] ?trim ] unit-test
 
-{ t } [ "ABC" dup [ blank? ] ?trim-head [ identity-hashcode ] same? ] unit-test
-{ t } [ "ABC" dup [ blank? ] ?trim-tail [ identity-hashcode ] same? ] unit-test
-{ "ABC " } [ " ABC " [ blank? ] ?trim-head ] unit-test
-{ " ABC" } [ " ABC " [ blank? ] ?trim-tail ] unit-test
+{ t } [ "ABC" dup [ ascii:blank? ] ?trim-head [ identity-hashcode ] same? ] unit-test
+{ t } [ "ABC" dup [ ascii:blank? ] ?trim-tail [ identity-hashcode ] same? ] unit-test
+{ "ABC " } [ " ABC " [ ascii:blank? ] ?trim-head ] unit-test
+{ " ABC" } [ " ABC " [ ascii:blank? ] ?trim-tail ] unit-test
 
 { "" } [ "" "" "" unsurround ] unit-test
 { "" } [ "  " " " " " unsurround ] unit-test
@@ -211,10 +211,10 @@ tools.test vectors vocabs ;
 { "cdef" } [ 2 f "abcdef" subseq* ] unit-test
 { "cd" } [ -4 -2 "abcdef" subseq* ] unit-test
 
-{ "foo" "" } [ "foo" [ blank? ] cut-when ] unit-test
-{ "foo" " " } [ "foo " [ blank? ] cut-when ] unit-test
-{ "" " foo" } [ " foo" [ blank? ] cut-when ] unit-test
-{ "foo" " bar" } [ "foo bar" [ blank? ] cut-when ] unit-test
+{ "foo" "" } [ "foo" [ ascii:blank? ] cut-when ] unit-test
+{ "foo" " " } [ "foo " [ ascii:blank? ] cut-when ] unit-test
+{ "" " foo" } [ " foo" [ ascii:blank? ] cut-when ] unit-test
+{ "foo" " bar" } [ "foo bar" [ ascii:blank? ] cut-when ] unit-test
 
 { { 4 0 3 1 2 } } [ { 0 4 1 3 2 } 5 <iota> [ nth* ] curry map ] unit-test
 
index 045f22e666fb6596cefc5c63c8988cebc8eb6d41..75b62958c9b621c7862be19de4b6269c88dca739 100644 (file)
@@ -21,7 +21,7 @@ tools.test ;
 
 { { "hello" " " " " " " "world" } } [
     "hello   world"
-    [ [ blank? ] find drop ] split-find
+    [ [ ascii:blank? ] find drop ] split-find
     [ >string ] map
 ] unit-test
 
index 846ed9f707fc780993b6bf40034d9d723f233d62..88f537953a995905183b84bfcb0a44616fc84bd3 100644 (file)
@@ -11,7 +11,7 @@ IN: text-analysis
 <PRIVATE
 
 : trimmed ( seq -- seq )
-    [ [ blank? ] trim ] map harvest ;
+    [ [ unicode:blank? ] trim ] map harvest ;
 
 : split-paragraphs ( str -- seq )
     R/ \r?\n\r?\n/ re-split trimmed ;
@@ -111,7 +111,7 @@ TUPLE: text-analysis #paragraphs #sentences #chars #words
     {
         [ split-paragraphs length ]
         [ split-sentences length ]
-        [ [ blank? not ] count ]
+        [ [ unicode:blank? not ] count ]
         [ split-words ]
     } cleave {
         [ length ]
index cd172e1c3b71cfa142391c8805e68de57ae1d349..e39616a624a920a6bb502984c56baf7cd8b8d614 100644 (file)
@@ -34,14 +34,14 @@ DEFER: name/values
     dup find-` [
         dup 1 - pick ?nth CHAR: : =
         [ drop name/values ] [ cut swap (parse-value) ] if
-        [ rest [ blank? ] trim-head ] dip
+        [ rest [ unicode:blank? ] trim-head ] dip
     ] [ f swap ] if* ;
 
 : (name=value) ( string -- remain term )
     parse-name [ parse-value ] dip associate ;
 
 : name=value ( string -- remain term )
-    [ blank? ] trim
+    [ unicode:blank? ] trim
     ":`" over subseq? [ (name=value) ] [ f swap ] if ;
 
 : name/values ( string -- remain terms )
index f0af5fb4ba4df126ad6e9a3d3b5667066a3f1324..8101daa50fc98d899ca363cde74502a909887249 100644 (file)
@@ -16,7 +16,7 @@ TUPLE: help-webapp < dispatcher ;
     <page-action>
         { help-webapp "search" } >>template
         [
-            "search" param [ blank? ] trim [
+            "search" param [ unicode:blank? ] trim [
                 help-dir [
                     [ article-apropos links "articles" set-value ]
                     [ word-apropos links "words" set-value ]