]> gitweb.factorcode.org Git - factor.git/commitdiff
Massive name change in files, string streams
authorDaniel Ehrenberg <ehrenbed@carleton.edu>
Sat, 16 Feb 2008 04:20:31 +0000 (22:20 -0600)
committerDaniel Ehrenberg <ehrenbed@carleton.edu>
Sat, 16 Feb 2008 04:20:31 +0000 (22:20 -0600)
69 files changed:
core/alien/compiler/compiler-tests.factor
core/bootstrap/image/image.factor
core/classes/classes-tests.factor
core/inspector/inspector-tests.factor
core/io/files/files-docs.factor
core/io/files/files-tests.factor
core/io/files/files.factor
core/io/io-tests.factor
core/io/streams/c/c-tests.factor
core/io/streams/string/string-docs.factor
core/io/streams/string/string-tests.factor
core/io/streams/string/string.factor
core/kernel/kernel-tests.factor
core/parser/parser.factor
core/prettyprint/prettyprint-tests.factor
core/prettyprint/prettyprint.factor
extra/asn1/asn1.factor
extra/benchmark/fasta/fasta.factor
extra/benchmark/knucleotide/knucleotide.factor
extra/benchmark/mandel/mandel.factor
extra/benchmark/raytracer/raytracer.factor
extra/benchmark/sum-file/sum-file.factor
extra/bootstrap/image/upload/upload.factor
extra/builder/builder.factor
extra/builder/test/test.factor
extra/builder/util/util.factor
extra/bunny/model/model.factor
extra/calendar/calendar.factor
extra/cpu/8080/emulator/emulator.factor
extra/editors/jedit/jedit.factor
extra/fjsc/fjsc.factor
extra/graphics/bitmap/bitmap.factor
extra/help/cookbook/cookbook.factor
extra/help/lint/lint.factor
extra/help/markup/markup-tests.factor
extra/hexdump/hexdump.factor
extra/html/elements/elements-tests.factor
extra/html/html-tests.factor
extra/http/server/templating/templating-tests.factor
extra/http/server/templating/templating.factor
extra/id3/id3.factor
extra/io/mmap/mmap-tests.factor
extra/io/unix/unix-tests.factor
extra/json/writer/writer.factor
extra/logging/insomniac/insomniac.factor
extra/logging/logging.factor
extra/msxml-to-csv/msxml-to-csv.factor
extra/pack/pack-tests.factor
extra/peg/search/search.factor
extra/rss/rss.factor
extra/serialize/serialize-docs.factor
extra/serialize/serialize-tests.factor
extra/smtp/smtp-tests.factor
extra/tar/tar.factor
extra/tools/browser/browser.factor
extra/tools/disassembler/disassembler.factor
extra/tools/interpreter/interpreter-tests.factor
extra/tools/test/ui/ui.factor
extra/ui/commands/commands-tests.factor
extra/ui/gadgets/gadgets-tests.factor
extra/ui/gadgets/panes/panes-tests.factor
extra/ui/gadgets/presentations/presentations-tests.factor
extra/ui/operations/operations-tests.factor
extra/xml/generator/generator-tests.factor
extra/xml/writer/writer.factor
unmaintained/factorbot.factor
unmaintained/farkup/farkup.factor
unmaintained/furnace-onigiri/onigiri.factor
unmaintained/io/test/mmap.factor

index c0c3733afa9b11f107d727e4fcc2d900092a09d7..876310cc5d2ee7a6cb7ee31387e2ff39e8420a8e 100755 (executable)
@@ -315,7 +315,7 @@ FUNCTION: double ffi_test_36 ( test-struct-12 x ) ;
     data-gc ;\r
 \r
 [ "Hello world" ] [ \r
-    [ callback-4 callback_test_1 ] string-out\r
+    [ callback-4 callback_test_1 ] with-string-writer\r
 ] unit-test\r
 \r
 : callback-5\r
index 7c12b3ea60f8733895870164244f11aa3d6f6d2a..17b56458ce905a9018d476324a07abeb7b06e840 100755 (executable)
@@ -416,7 +416,7 @@ M: curry '
     "Writing image to " write
     architecture get boot-image-name resource-path
     dup write "..." print flush
-    <file-writer> [ (write-image) ] with-stream ;
+    [ (write-image) ] with-file-writer ;
 
 PRIVATE>
 
index c7024a74901a577e15823a6efb50fa07619f5c58..103c4eed0928db6c5e0094d9b101f5d997577bbf 100755 (executable)
@@ -63,7 +63,7 @@ UNION: bah fixnum alien ;
 
 ! Test generic see and parsing
 [ "USING: alien math ;\nIN: temporary\nUNION: bah fixnum alien ;\n" ]
-[ [ \ bah see ] string-out ] unit-test
+[ [ \ bah see ] with-string-writer ] unit-test
 
 ! Test redefinition of classes
 UNION: union-1 fixnum float ;
index 4cb638c3de57cdf19028aff103703fafbdbde6d1..fce0cc0c86198bafc965357c18264bc2d7aca9e6 100644 (file)
@@ -8,4 +8,4 @@ f describe
 H{ } describe
 H{ } describe
 
-[ "fixnum instance\n" ] [ [ 3 describe ] string-out ] unit-test
+[ "fixnum instance\n" ] [ [ 3 describe ] with-string-writer ] unit-test
index 99f2d42542766c6391c3f3e78c630b2d63251e3b..185fa1436b5bb78efa464677ecd6790c50bb6e55 100755 (executable)
@@ -52,12 +52,12 @@ HELP: <file-appender>
 { $description "Outputs an output stream for writing to the specified pathname. The stream begins writing at the end of the file." }
 { $errors "Throws an error if the file cannot be opened for writing." } ;
 
-HELP: with-file-in
+HELP: with-file-reader
 { $values { "path" "a pathname string" } { "quot" "a quotation" } }
 { $description "Opens a file for reading and calls the quotation using " { $link with-stream } "." }
 { $errors "Throws an error if the file is unreadable." } ;
 
-HELP: with-file-out
+HELP: with-file-writer
 { $values { "path" "a pathname string" } { "quot" "a quotation" } }
 { $description "Opens a file for writing and calls the quotation using " { $link with-stream } "." }
 { $errors "Throws an error if the file cannot be opened for writing." } ;
index bac9a2e65e67b4f0ef0c362f392ba06635ec1601..d0f9737f19b13d827a55bf96ec2a1b8834b57d7b 100755 (executable)
@@ -6,9 +6,9 @@ USING: tools.test io.files io threads kernel continuations ;
 [ "awk" ] [ "/usr/libexec/awk///" file-name ] unit-test
 
 [ ] [
-    "test-foo.txt" resource-path <file-writer> [
+    "test-foo.txt" resource-path [
         "Hello world." print
-    ] with-stream
+    ] with-file-writer
 ] unit-test
 
 [ ] [
@@ -55,11 +55,11 @@ USING: tools.test io.files io threads kernel continuations ;
 
 [ f ] [ "test-blah" resource-path exists? ] unit-test
 
-[ ] [ "test-quux.txt" resource-path <file-writer> [ [ yield "Hi" write ] in-thread ] with-stream ] unit-test
+[ ] [ "test-quux.txt" resource-path [ [ yield "Hi" write ] in-thread ] with-file-writer ] unit-test
 
 [ ] [ "test-quux.txt" resource-path delete-file ] unit-test
 
-[ ] [ "test-quux.txt" resource-path <file-writer> [ [ yield "Hi" write ] in-thread ] with-stream ] unit-test
+[ ] [ "test-quux.txt" resource-path [ [ yield "Hi" write ] in-thread ] with-file-writer ] unit-test
 
 [ ] [ "test-quux.txt" "quux-test.txt" [ resource-path ] 2apply rename-file ] unit-test
 [ t ] [ "quux-test.txt" resource-path exists? ] unit-test
index 9afe9362cf321d37b487a9bdc4f1affe4e290ed1..d773d0602c57f33c3eebda0f289dc9c984c28dcb 100755 (executable)
@@ -116,11 +116,10 @@ HOOK: copy-file io-backend ( from to -- )
 M: object copy-file
     dup parent-directory make-directories
     <file-writer> [
-        stdio get swap
-        <file-reader> [
-            stdio get swap stream-copy
-        ] with-stream
-    ] with-stream ;
+        swap <file-reader> [
+            swap stream-copy
+        ] with-disposal
+    ] with-disposal ;
 
 : copy-directory ( from to -- )
     dup make-directories
@@ -146,10 +145,10 @@ M: pathname <=> [ pathname-string ] compare ;
 : file-contents ( path -- str )
     dup <file-reader> swap file-length <sbuf> [ stream-copy ] keep >string ;
 
-: with-file-in ( path quot -- )
+: with-file-writer ( path quot -- )
     >r <file-reader> r> with-stream ; inline
 
-: with-file-out ( path quot -- )
+: with-file-reader ( path quot -- )
     >r <file-writer> r> with-stream ; inline
 
 : with-file-appender ( path quot -- )
index ab1d00ea3d0326e5c68a4f6d452f27aa8e7b2adc..23686abab54ab77b4f6a1f9ddac50505536ae0bb 100644 (file)
@@ -53,7 +53,7 @@ IN: temporary
 ] unit-test
 
 [ ] [
-    image <file-reader> [
+    image [
         10 [ 65536 read drop ] times
-    ] with-stream
+    ] with-file-reader
 ] unit-test
index 74a17ffc4c9022ec99ed4d9c024834001409621f..5ace929ceba43b85a51a5044d2f19a5a22bb1591 100755 (executable)
@@ -2,9 +2,9 @@ USING: tools.test io.files io io.streams.c ;
 IN: temporary
 
 [ "hello world" ] [
-    "test.txt" resource-path <file-writer> [
+    "test.txt" resource-path [
         "hello world" write
-    ] with-stream
+    ] with-file-writer
 
     "test.txt" resource-path "rb" fopen <c-reader> contents
 ] unit-test
index 45238c8c31af9226d8a958d7e3ecd4256d35394a..e948d2162aa76c078e271b48434cc76f681b1126 100644 (file)
@@ -6,8 +6,8 @@ ARTICLE: "io.streams.string" "String streams"
 { $subsection <string-reader> }
 { $subsection <string-writer> }
 "Utility combinators:"
-{ $subsection string-in }
-{ $subsection string-out } ;
+{ $subsection with-string-reader }
+{ $subsection with-string-writer } ;
 
 ABOUT: "io.streams.string"
 
@@ -15,7 +15,7 @@ HELP: <string-writer>
 { $values { "stream" "an output stream" } }
 { $description "Creates an output stream that collects text into a delegate string buffer. The contents of the buffer can be recovered by executing " { $link >string } ", and indeed all other sequence operations are permitted by virtue of the delegation." } ;
 
-HELP: string-out
+HELP: with-string-writer
 { $values { "quot" quotation } { "str" string } }
 { $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to a new string writer. The accumulated string is output when the quotation returns." } ;
 
@@ -24,6 +24,6 @@ HELP: <string-reader>
 { $description "Creates a new stream for reading " { $snippet "str" } " from beginning to end." }
 { $notes "The implementation exploits the ability of string buffers to respond to the input stream protocol by reading characters from the end of the buffer." } ;
 
-HELP: string-in
+HELP: with-string-reader
 { $values { "str" string } { "quot" quotation } }
 { $description "Calls the quotation in a new dynamic scope with " { $link stdio } " rebound to an input stream reading " { $snippet "str" } " from beginning to end. The accumulated string is output when the quotation returns." } ;
index 277d9ebf9c0923c993d10e18d83bf9a72e2a951f..ad46233501abef1ef264e3de55713b9fcf92979e 100644 (file)
@@ -12,7 +12,7 @@ unit-test
 [ "" <string-reader> stream-readln ]
 unit-test
 
-[ "xyzzy" ] [ [ "xyzzy" write ] string-out ] unit-test
+[ "xyzzy" ] [ [ "xyzzy" write ] with-string-writer ] unit-test
 
 [ "a" ] [ 1 SBUF" cba" stream-read ] unit-test
 [ "ab" ] [ 2 SBUF" cba" stream-read ] unit-test
index f39855bb582c0e7c07a58065d6f89ef806223153..42726e77626fc8f38583aa34110ec4ffeaaeca78 100755 (executable)
@@ -14,7 +14,7 @@ M: growable stream-flush drop ;
 : <string-writer> ( -- stream )
     512 <sbuf> <plain-writer> ;
 
-: string-out ( quot -- str )
+: with-string-writer ( quot -- str )
     <string-writer> swap [ stdio get ] compose with-stream*
     >string ; inline
 
@@ -75,7 +75,7 @@ M: growable stream-read-partial
 : <string-reader> ( str -- stream )
     >sbuf dup reverse-here <line-reader> ;
 
-: string-in ( str quot -- )
+: with-string-reader ( str quot -- )
     >r <string-reader> r> with-stream ; inline
 
 : <byte-reader> ( byte-array encoding -- stream )
index e37b208ef099b02bf628edd81c6f5f62a4787d14..2972cb2d5d37b9d074a08db5b6a795a6efe3f5fc 100755 (executable)
@@ -32,7 +32,7 @@ IN: temporary
 
 [ overflow-d-alt ] [ { "kernel-error" 12 f f } = ] must-fail-with
 
-[ ] [ [ :c ] string-out drop ] unit-test
+[ ] [ [ :c ] with-string-writer drop ] unit-test
 
 : overflow-r 3 >r overflow-r ;
 
@@ -80,8 +80,8 @@ IN: temporary
 [ 0 ] [ f [ 0 ] unless* ] unit-test
 [ t ] [ t [ "Hello" ] unless* ] unit-test
 
-[ "2\n" ] [ [ 1 2 [ . ] [ sq . ] ?if ] string-out ] unit-test
-[ "9\n" ] [ [ 3 f [ . ] [ sq . ] ?if ] string-out ] unit-test
+[ "2\n" ] [ [ 1 2 [ . ] [ sq . ] ?if ] with-string-writer ] unit-test
+[ "9\n" ] [ [ 3 f [ . ] [ sq . ] ?if ] with-string-writer ] unit-test
 
 [ f ] [ f (clone) ] unit-test
 [ -123 ] [ -123 (clone) ] unit-test
index c84c836390a2ec96b410142f2170af901bd232bb..fc29445f88fc39434bd3cc351df10fb02fc7c21b 100755 (executable)
@@ -513,4 +513,4 @@ SYMBOL: interactive-vocabs
     [
         parser-notes off
         [ [ eval ] keep ] try drop
-    ] string-out ;
+    ] with-string-writer ;
index a7e087ffadb27b21b144b6926647c04dfa057044..11a685d581b0614746f40ea7867ed77d766cfd6f 100755 (executable)
@@ -67,19 +67,19 @@ unit-test
 [ "[ \\ [ ]" ] [ [ \ [ ] unparse ] unit-test
     
 [ t ] [
-    100 \ dup <array> [ pprint-short ] string-out
+    100 \ dup <array> [ pprint-short ] with-string-writer
     "{" head?
 ] unit-test
 
 : foo ( a -- b ) dup * ; inline
 
 [ "USING: kernel math ;\nIN: temporary\n: foo ( a -- b ) dup * ; inline\n" ]
-[ [ \ foo see ] string-out ] unit-test
+[ [ \ foo see ] with-string-writer ] unit-test
 
 : bar ( x -- y ) 2 + ;
 
 [ "USING: math ;\nIN: temporary\n: bar ( x -- y ) 2 + ;\n" ]
-[ [ \ bar see ] string-out ] unit-test
+[ [ \ bar see ] with-string-writer ] unit-test
 
 : blah 
     drop
@@ -105,7 +105,7 @@ unit-test
 
 [ "drop ;" ] [
     \ blah f "inferred-effect" set-word-prop
-    [ \ blah see ] string-out "\n" ?tail drop 6 tail*
+    [ \ blah see ] with-string-writer "\n" ?tail drop 6 tail*
 ] unit-test
 
 : check-see ( expect name -- )
@@ -116,7 +116,7 @@ unit-test
             [ parse-fresh drop ] with-compilation-unit
             [
                 "temporary" lookup see
-            ] string-out "\n" split 1 head*
+            ] with-string-writer "\n" split 1 head*
         ] keep =
     ] with-scope ;
 
@@ -295,7 +295,7 @@ unit-test
     "IN: temporary\nGENERIC: generic-decl-test ( a -- b ) flushable\n"
     dup eval
     "generic-decl-test" "temporary" lookup
-    [ see ] string-out =
+    [ see ] with-string-writer =
 ] unit-test
 
 [ [ + ] ] [
index ed52f0238cc7be9a244922baffe45df48d5c2e59..2d4e6ced1421f94eb814e96edf732a37872213ff 100755 (executable)
@@ -63,9 +63,9 @@ combinators quotations ;
 
 : pprint-use ( obj -- ) [ pprint* ] with-use ;
 
-: unparse ( obj -- str ) [ pprint ] string-out ;
+: unparse ( obj -- str ) [ pprint ] with-string-writer ;
 
-: unparse-use ( obj -- str ) [ pprint-use ] string-out ;
+: unparse-use ( obj -- str ) [ pprint-use ] with-string-writer ;
 
 : pprint-short ( obj -- )
     H{
@@ -192,7 +192,7 @@ M: pathname synopsis* pprint* ;
         0 margin set
         1 line-limit set
         [ synopsis* ] with-in
-    ] string-out ;
+    ] with-string-writer ;
 
 GENERIC: declarations. ( obj -- )
 
index 8b44c20479872a207952bd1d312f41193f4906d2..99d1e0a19d4947f3b44663187b2880d9edd7d3fa 100644 (file)
@@ -112,7 +112,7 @@ SYMBOL: end
         { "boolean" [ "\0" = not ] }
         { "string" [ "" or ] }
         { "integer" [ be> ] }
-        { "array" [ "" or [ read-array ] string-in ] }
+        { "array" [ "" or [ read-array ] with-string-reader ] }
     } case ;
 
 : read-ber ( syntax -- object )
index 280bc365a29dd6880b02f54761c7ac105d1109b0..75321def2d69a8ad4e6ce7f7ab89e5c039b42c2d 100644 (file)
@@ -101,7 +101,7 @@ HINTS: random fixnum ;
             n 3 * homo-sapiens-chars homo-sapiens-floats "IUB ambiguity codes" "TWO" write-random-fasta
             n 5 * IUB-chars IUB-floats "Homo sapiens frequency" "THREE" write-random-fasta
             drop
-        ] with-file-out
+        ] with-file-writer
 
     ] with-locals ;
 
index ad1ffc1c5017e7952a01807a0dabc80d3cc8edfa..b95e182bd1dd97a13da7865277e2ae87395396be 100644 (file)
@@ -57,8 +57,7 @@ IN: benchmark.knucleotide
 
 : knucleotide ( -- )
     "extra/benchmark/knucleotide/knucleotide-input.txt" resource-path
-    <file-reader>
-    [ read-input ] with-stream
+    [ read-input ] with-file-reader
     process-input ;
 
 MAIN: knucleotide
index 4aacadff235c3b7f35649cb3cab3fc2a20a64747..230fb2f889f930387af782961551962739516138 100755 (executable)
@@ -65,7 +65,7 @@ SYMBOL: cols
     ] with-scope ;
 
 : mandel-main ( -- )
-    "mandel.ppm" resource-path <file-writer>
-    [ mandel write ] with-stream ;
+    "mandel.ppm" resource-path
+    [ mandel write ] with-file-writer ;
 
 MAIN: mandel-main
index 127392d237c52116f823ecb6b588dbe84ae77f94..8f2badc95f064777e35a55e47a15732a15a0a018 100644 (file)
@@ -171,6 +171,6 @@ DEFER: create ( level c r -- scene )
 
 : raytracer-main
     "raytracer.pnm" resource-path
-    <file-writer> [ run write ] with-stream ;
+    [ run write ] with-file-writer ;
 
 MAIN: raytracer-main
index 14166feb5bc563b3cf256456b219b799651ef49d..e17765d5425c27ab48bcbcf49b760ff4b31ce19c 100644 (file)
@@ -5,7 +5,7 @@ IN: benchmark.sum-file
     readln [ string>number + sum-file-loop ] when* ;
 
 : sum-file ( file -- )
-    <file-reader> [ 0 sum-file-loop ] with-stream . ;
+    [ 0 sum-file-loop ] with-file-reader . ;
 
 : sum-file-main ( -- )
     home "sum-file-in.txt" path+ sum-file ;
index 3b5ab4cb77db7425197272fe136eeef54bc12b6a..552e26ebf557f2cdbd76e796dbb1ed453fb5f091 100755 (executable)
@@ -11,7 +11,7 @@ bootstrap.image sequences io namespaces io.launcher math ;
 : compute-checksums ( -- )
     "checksums.txt" [
         boot-image-names [ dup write bl file>md5str print ] each
-    ] with-file-out ;
+    ] with-file-writer ;
 
 : upload-images ( -- )
     [
index cd17a32255a48339c9c56b2cdb550001f2d94887..e28510ccea2f56397e5d9dba721006f6907fb079 100644 (file)
@@ -48,7 +48,7 @@ VAR: stamp
 : git-id ( -- id )
   { "git" "show" } <process-stream> [ readln ] with-stream " " split second ;
 
-: record-git-id ( -- ) git-id "../git-id" [ . ] with-file-out ;
+: record-git-id ( -- ) git-id "../git-id" [ . ] with-file-writer ;
 
 : make-clean ( -- desc ) { "make" "clean" } ;
 
@@ -132,9 +132,9 @@ SYMBOL: build-status
     "Did not pass test-all: "        print "../test-all-vocabs"        cat
 
     "Benchmarks: " print
-    "../benchmarks" [ stdio get contents eval ] with-file-in benchmarks.
+    "../benchmarks" [ stdio get contents eval ] with-file-reader benchmarks.
 
-  ] with-file-out
+  ] with-file-writer
 
   build-status on ;
 
index 7412dd9b3698630f1e04d612caef5c4d3680493c..c664941132abfebde838998e607c8afbd7705432 100644 (file)
@@ -11,17 +11,17 @@ USING: kernel namespaces sequences assocs builder continuations
 IN: builder.test
 
 : do-load ( -- )
-  try-everything keys "../load-everything-vocabs" [ . ] with-file-out ;
+  try-everything keys "../load-everything-vocabs" [ . ] with-file-writer ;
 
 : do-tests ( -- )
-  run-all-tests keys "../test-all-vocabs" [ . ] with-file-out ;
+  run-all-tests keys "../test-all-vocabs" [ . ] with-file-writer ;
 
-: do-benchmarks ( -- ) run-benchmarks "../benchmarks" [ . ] with-file-out ;
+: do-benchmarks ( -- ) run-benchmarks "../benchmarks" [ . ] with-file-writer ;
 
 : do-all ( -- )
-  bootstrap-time get   "../boot-time" [ . ] with-file-out
-  [ do-load  ] runtime "../load-time" [ . ] with-file-out
-  [ do-tests ] runtime "../test-time" [ . ] with-file-out
+  bootstrap-time get   "../boot-time" [ . ] with-file-writer
+  [ do-load  ] runtime "../load-time" [ . ] with-file-writer
+  [ do-tests ] runtime "../test-time" [ . ] with-file-writer
   do-benchmarks ;
 
 MAIN: do-all
\ No newline at end of file
index f9f432a8f6b4bb2d596afbcef8ed3028f78811fb..9f2c76778f3166093173bc9b4d1d561a1ad95001 100644 (file)
@@ -14,7 +14,7 @@ IN: builder.util
 
 : minutes>ms ( min -- ms ) 60 * 1000 * ;
 
-: file>string ( file -- string ) [ stdio get contents ] with-file-in ;
+: file>string ( file -- string ) [ stdio get contents ] with-file-reader ;
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
index 4da6a5e379cba7dccbd269ba42507ad3cede6ce0..7c77ed98af92283c95a3bf96d70b16c6943d9fc1 100644 (file)
@@ -18,13 +18,7 @@ IN: bunny.model
     ] when* ;
 
 : parse-model ( stream -- vs is )
-    [
-        100000 <vector> 100000 <vector> (parse-model)
-    ] with-stream
-    [
-        over length # " vertices, " %
-        dup length # " triangles" %
-    ] "" make print ;
+    100000 <vector> 100000 <vector> (parse-model) ;
 
 : n ( vs triple -- n )
     swap [ nth ] curry map
@@ -41,7 +35,8 @@ IN: bunny.model
 
 : read-model ( stream -- model )
     "Reading model" print flush [
-        <file-reader> parse-model [ normals ] 2keep 3array
+        [ parse-model ] with-file-reader
+        [ normals ] 2keep 3array
     ] time ;
 
 : model-path "bun_zipper.ply" ;
index 012080d3b74ae42a71ce8f5f05ce7aaaff843dde..a8d76ac86f373555d9d800419aaa46a483aade52 100755 (executable)
@@ -347,7 +347,7 @@ M: timestamp year. ( timestamp -- )
     timestamp-second >fixnum write-00 ;
 
 : timestamp>string ( timestamp -- str )
-    [ (timestamp>string) ] string-out ;
+    [ (timestamp>string) ] with-string-writer ;
 
 : (write-gmt-offset) ( ratio -- )
     1 /mod swap write-00 60 * write-00 ;
@@ -366,7 +366,7 @@ M: timestamp year. ( timestamp -- )
         dup (timestamp>string)
         " " write
         timestamp-gmt-offset write-gmt-offset
-    ] string-out ;
+    ] with-string-writer ;
 
 : timestamp>http-string ( timestamp -- str )
     #! http timestamp format
@@ -382,7 +382,7 @@ M: timestamp year. ( timestamp -- )
     timestamp-second >fixnum write-00 CHAR: Z write1 ;
 
 : timestamp>rfc3339 ( timestamp -- str )
-    >gmt [ (timestamp>rfc3339) ] string-out ;
+    >gmt [ (timestamp>rfc3339) ] with-string-writer ;
 
 : expect read1 assert= ;
 
@@ -401,7 +401,7 @@ M: timestamp year. ( timestamp -- )
     0 <timestamp> ;
 
 : rfc3339>timestamp ( str -- timestamp )
-    [ (rfc3339>timestamp) ] string-in ;
+    [ (rfc3339>timestamp) ] with-string-reader ;
 
 : file-time-string ( timestamp -- string )
     [
@@ -413,7 +413,7 @@ M: timestamp year. ( timestamp -- )
         ] [
             timestamp-year number>string 5 32 pad-left write
         ] if
-    ] string-out ;
+    ] with-string-writer ;
 
 : day-offset ( timestamp m -- timestamp n )
     over day-of-week - ; inline
index 310e387bd5b59d045ddc31ab75084ee8e03bad5d..9499ff8dff733ea5258dc7f0623ac4bf1f0c462f 100755 (executable)
@@ -461,9 +461,9 @@ M: cpu reset ( cpu -- )
 : load-rom ( filename cpu -- )
   #! Load the contents of the file into ROM.
   #! (address 0x0000-0x1FFF).
-  cpu-ram swap <file-reader> 
+  cpu-ram swap [ 
     0 swap (load-rom)
-  ] with-stream ;
+  ] with-file-reader ;
 
 SYMBOL: rom-root
 
@@ -477,9 +477,9 @@ SYMBOL: rom-root
   #! file path shoul dbe relative to the '/roms' resource path.
   rom-dir [
     cpu-ram [
-      swap first2 rom-dir swap path+ <file-reader> [      
+      swap first2 rom-dir swap path+ [      
         swap (load-rom)
-      ] with-stream
+      ] with-file-reader
     ] curry each 
   ] [
     ! 
index a3a244683613a5d83c2a6b9fb46cfb7c0b200968..fd5b6c1b068854ded0d81d4064b43b2353471a12 100644 (file)
@@ -7,11 +7,11 @@ math.parser ;
 IN: editors.jedit
 
 : jedit-server-info ( -- port auth )
-    home "/.jedit/server" path+ <file-reader> [
+    home "/.jedit/server" path+ [
         readln drop
         readln string>number
         readln string>number
-    ] with-stream ;
+    ] with-file-reader ;
 
 : make-jedit-request ( files -- code )
     [
@@ -21,7 +21,7 @@ IN: editors.jedit
         "new String[] {" write
         [ pprint "," write ] each
         "null});\n" write
-    ] string-out ;
+    ] with-string-writer ;
 
 : send-jedit-request ( request -- )
     jedit-server-info swap "localhost" swap <inet> <client> [
index ee6212ce98badeb30f6c2752828b106190c6b023..1e314a51a2ba09be5d23d475a45675dab53b0a31 100755 (executable)
@@ -368,7 +368,7 @@ M: quotation fjsc-parse ( object -- ast )
       (compile)
       ")" ,
     ] { } make [ write ] each
-  ] string-out ;
+  ] with-string-writer ;
 
 : fjsc-compile* ( string -- string )
   'statement' parse parse-result-ast fjsc-compile ;
@@ -382,5 +382,5 @@ M: quotation fjsc-parse ( object -- ast )
 : fjsc-literal ( ast -- string )
   [
     [ (literal) ] { } make [ write ] each
-  ] string-out ;
+  ] with-string-writer ;
 
index 9539d9ecc1c49c1180ac62161890c89896ad8c77..8e61766de18b04d28401119502a11fa7ace00866 100644 (file)
@@ -59,17 +59,17 @@ TUPLE: bitmap magic size reserved offset header-length width
     dup color-index-length read swap set-bitmap-color-index ;
 
 : load-bitmap ( path -- bitmap )
-    <file-reader> [
+    [
         T{ bitmap } clone
         dup parse-file-header
         dup parse-bitmap-header
         dup parse-bitmap
-    ] with-stream
+    ] with-file-reader
     dup bitmap-color-index over bitmap-bit-count
     raw-bitmap>string >byte-array over set-bitmap-array ;
 
 : save-bitmap ( bitmap path -- )
-    <file-writer> [
+    [
         "BM" write
         dup bitmap-array length 14 + 40 + 4 >le write
         0 4 >le write
@@ -88,7 +88,7 @@ TUPLE: bitmap magic size reserved offset header-length width
         dup bitmap-color-important 4 >le write
         dup bitmap-rgb-quads write
         bitmap-color-index write
-    ] with-stream ;
+    ] with-file-writer ;
 
 M: bitmap draw-image ( bitmap -- )
     dup bitmap-height 0 < [
index 654f863fd6e9f46cd2e710a713ec7628c72f0ac3..5be69663f8123c0ba2dd0e7c71666f5cd3deee91 100755 (executable)
@@ -195,7 +195,7 @@ ARTICLE: "cookbook-io" "Input and output cookbook"
 }
 "Read 1024 bytes from a file:"
 { $code
-    "\"data.bin\" <file-reader> [ 1024 read ] with-stream"
+    "\"data.bin\" [ 1024 read ] with-file-reader"
 }
 "Convert a file of 4-byte cells from little to big endian or vice versa, by directly mapping it into memory:"
 { $code
index 6496ca21ff985bbd74552ceb208ce3008a0b6781..3c11a9350923bc9cdd9b683c281b6f9a55bf0740 100644 (file)
@@ -69,7 +69,7 @@ IN: help.lint
     ] each ;
 
 : check-rendering ( word element -- )
-    [ help ] string-out drop ;
+    [ help ] with-string-writer drop ;
 
 : all-word-help ( words -- seq )
     [ word-help ] subset ;
index f8675bec8c0c54179fcb57844f1dc76800ee4d82..71a9b5476096c53fa8b466d39b7b02075a143fd9 100644 (file)
@@ -16,7 +16,7 @@ TUPLE: blahblah quux ;
     test-slot blahblah $spec-reader-values
 ] unit-test
 
-[ "an int" ] [ [ { "int" } $instance ] string-out ] unit-test
+[ "an int" ] [ [ { "int" } $instance ] with-string-writer ] unit-test
 
 [ ] [ \ blahblah-quux help ] unit-test
 [ ] [ \ set-blahblah-quux help ] unit-test
index 3aaf464355e4866d49c0a80c5203285161b7c401..468a8cf25362f6e99fd370e5f37e801d56c65c7f 100644 (file)
@@ -25,7 +25,7 @@ PRIVATE>
     [
         dup length header.
         16 <sliced-groups> [ line. ] each-index
-    ] string-out ;
+    ] with-string-writer ;
 
 : hexdump. ( seq -- )
     hexdump write ;
index 786fe0e68c5c92f2537d2591259b88f2b608e9aa..aab00e0ca32643c5e61cd72bb82ac9fa8b7d85b6 100644 (file)
@@ -2,7 +2,7 @@ IN: temporary
 USING: tools.test html html.elements io.streams.string ;
 
 : make-html-string
-    [ with-html-stream ] string-out ;
+    [ with-html-stream ] with-string-writer ;
 
 [ "<a href='h&amp;o'>" ]
 [ [ <a "h&o" =href a> ] make-html-string ] unit-test
index 5c33df18b3d3ec09b296fd555c78ac701159c23d..4e3344855fcded013e5b25bede4e5411d5c916e8 100644 (file)
@@ -3,7 +3,7 @@ namespaces tools.test xml.writer sbufs sequences html.private ;
 IN: temporary
 
 : make-html-string
-    [ with-html-stream ] string-out ;
+    [ with-html-stream ] with-string-writer ;
 
 [ ] [
     512 <sbuf> <html-stream> drop
index d979a071f26d049f08c59d6a32dc7247c150d8bd..d889cd848a6c4c980cf8737a8efba40db6b309be 100644 (file)
@@ -6,7 +6,7 @@ IN: temporary
     "extra/http/server/templating/test/" swap append
     [
         ".fhtml" append resource-path
-        [ run-template-file ] string-out
+        [ run-template-file ] with-string-writer
     ] keep
     ".html" append resource-path file-contents = ;
 
index dc83562600053761b0843386f049fa9b78d04128..f364b86524643eb574a0e7b1a6460402913f2071 100755 (executable)
@@ -93,4 +93,4 @@ DEFER: <% delimiter
     swap path+ run-template-file ;
 
 : template-convert ( infile outfile -- )
-    <file-writer> [ run-template-file ] with-stream ;
+    [ run-template-file ] with-file-writer ;
index 2dcf0bf765e88c1e47ff266187b9b8bd9fa50d55..4f633f5be17862a89873a871bc1e4a9f6c3a19cc 100644 (file)
@@ -120,7 +120,7 @@ C: <extended-header> extended-header
   id3v2? [ read-id3v2 ] [ f ] if ;
 
 : id3v2 ( filename -- tag/f )
-  <file-reader> [ read-tag ] with-stream ;
+  [ read-tag ] with-file-reader ;
 
 : file? ( path -- ? )
   stat 3drop not ;
@@ -135,7 +135,7 @@ C: <extended-header> extended-header
   [ mp3? ] subset ;
 
 : id3? ( file -- ? )
-  <file-reader> [ id3v2? ] with-stream ;
+  [ id3v2? ] with-file-reader ;
 
 : id3s ( files -- id3s )
   [ id3? ] subset ;
index f0547961bc9cc87e4b17dd37a2043e2c2b2e4ee7..25caae036d237f2cf5c41e67241e88293297cf55 100644 (file)
@@ -2,7 +2,7 @@ USING: io io.mmap io.files kernel tools.test continuations sequences ;
 IN: temporary
 
 [ "mmap-test-file.txt" resource-path delete-file ] ignore-errors
-[ ] [ "mmap-test-file.txt" resource-path <file-writer> [ "12345" write ] with-stream ] unit-test
+[ ] [ "mmap-test-file.txt" resource-path [ "12345" write ] with-file-writer ] unit-test
 [ ] [ "mmap-test-file.txt" resource-path dup file-length [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
 [ 5 ] [ "mmap-test-file.txt" resource-path dup file-length [ length ] with-mapped-file ] unit-test
 [ "22345" ] [ "mmap-test-file.txt" resource-path file-contents ] unit-test
index 5a93257949f0b3b944247fe6728073d870385d13..e1c3108952d347740b81710249adfd99ca32f6ba 100755 (executable)
@@ -131,16 +131,16 @@ client-addr <datagram>
 ! Invalid parameter tests
 
 [
-    image <file-reader> [ stdio get accept ] with-stream
+    image [ stdio get accept ] with-file-reader
 ] must-fail
 
 [
-    image <file-reader> [ stdio get receive ] with-stream
+    image [ stdio get receive ] with-file-reader
 ] must-fail
 
 [
-    image <file-reader> [
+    image [
         B{ 1 2 } server-addr
         stdio get send
-    ] with-stream
+    ] with-file-reader
 ] must-fail
index 6c7d6cebb2cc6648774af2f630ef4de2b99f802b..4f3bd096135d7b013cabdbb52ea64e854a108de6 100644 (file)
@@ -10,7 +10,7 @@ GENERIC: json-print ( obj -- )
 
 : >json ( obj -- string )
   #! Returns a string representing the factor object in JSON format
-  [ json-print ] string-out ;
+  [ json-print ] with-string-writer ;
 
 M: f json-print ( f -- )
   drop "false" write ;
index 09c67636570a0d7d7ed836fb1cca41958df8bc65..bb143879bfc4046148bbdc37b0be8e3852b57952 100755 (executable)
@@ -11,7 +11,7 @@ SYMBOL: insomniac-recipients
 \r
 : ?analyze-log ( service word-names -- string/f )\r
     >r log-path 1 log# dup exists? [\r
-        file-lines r> [ analyze-log ] string-out\r
+        file-lines r> [ analyze-log ] with-string-writer\r
     ] [\r
         r> 2drop f\r
     ] if ;\r
index fec0c3660f2acaf65e4ceccdd5413e37c4187eba..1503e0016387950b7c4e63ef23fe3de476ecd6dd 100755 (executable)
@@ -103,7 +103,7 @@ PRIVATE>
 \r
 : (log-error) ( object word level -- )\r
     log-service get [\r
-        >r >r [ print-error ] string-out r> r> log-message\r
+        >r >r [ print-error ] with-string-writer r> r> log-message\r
     ] [\r
         2drop rethrow\r
     ] if ;\r
index dcd2819a2a746de085b2e611f14df4c577557dbe..8a9ba9cf98987107683c927e4538cadb0644be19 100644 (file)
@@ -13,6 +13,6 @@ IN: msxml-to-csv
     ] map ;
 
 : msxml>csv ( infile outfile -- )
-    <file-writer> [
+    [
         file>xml (msxml>csv) print-csv
-    ] with-stream ;
+    ] with-file-writer ;
index 7a888811895443e6e8404be31b42cf0e3e3b0f43..510e44d34e5589110b1d0c630075077fcd0af1fb 100755 (executable)
@@ -41,7 +41,7 @@ USING: io io.streams.string kernel namespaces pack strings tools.test ;
     <string-reader> [ "int" read-native ] with-stream
 ] unit-test
 
-[ "FRAM" ] [ "FRAM\0" [ read-c-string ] string-in ] unit-test
-[ f ] [ "" [ read-c-string ] string-in ] unit-test
-[ 5 ] [ "FRAM\0\u000005\0\0\0\0\0\0\0" [ read-c-string drop read-u64 ] string-in ] unit-test
+[ "FRAM" ] [ "FRAM\0" [ read-c-string ] with-string-reader ] unit-test
+[ f ] [ "" [ read-c-string ] with-string-reader ] unit-test
+[ 5 ] [ "FRAM\0\u000005\0\0\0\0\0\0\0" [ read-c-string drop read-u64 ] with-string-reader ] unit-test
 
index 6b34c038571dda59dfd8efc732668793724c4297..21a111f6f76d1c5d925c9f0eba240910bbb4bf28 100755 (executable)
@@ -27,6 +27,6 @@ MEMO: any-char-parser ( -- parser )
   any-char-parser 2array choice repeat0 parse parse-result-ast [ ] subset ;
 
 : replace ( string parser -- result )
- [  (replace) [ tree-write ] each ] string-out ;
+ [  (replace) [ tree-write ] each ] with-string-writer ;
 
 
index 0591c600143ce232e314d5b0c392311f13345cbc..99360e5509dd3098f9943bc6c1866cff964b9023 100644 (file)
@@ -55,7 +55,7 @@ C: <entry> entry
     [
         { "content" "summary" } any-tag-named
         dup tag-children [ string? not ] contains?
-        [ tag-children [ write-chunk ] string-out ]
+        [ tag-children [ write-chunk ] with-string-writer ]
         [ children>string ] if
     ] keep
     { "published" "updated" "issued" "modified" } any-tag-named
index 5f21b02ae73049785922c5fd98b5d5e993b8b575..e12751d6ab52b007a5e22b428077d0b2db4596f3 100644 (file)
@@ -8,7 +8,7 @@ HELP: (serialize)
 }
 { $description "Serializes the object to the current output stream. Object references within the structure being serialized are maintained. It must be called from within the scope of a " { $link with-serialized } " call." } 
 { $examples 
-    { $example "USING: serialize io.streams.string ;" "[\n  [ { 1 2 } dup  (serialize) (serialize) ] with-serialized\n] string-out\n\n[\n  [ (deserialize) (deserialize) ] with-serialized\n] string-in eq? ." "t" }
+    { $example "USING: serialize io.streams.string ;" "[\n  [ { 1 2 } dup  (serialize) (serialize) ] with-serialized\n] with-string-writer\n\n[\n  [ (deserialize) (deserialize) ] with-serialized\n] with-string-reader eq? ." "t" }
 }
 { $see-also deserialize (deserialize) serialize with-serialized } ;
 
@@ -17,7 +17,7 @@ HELP: (deserialize)
 }
 { $description "Deserializes an object by reading from the current input stream. Object references within the structure that was originally serialized are maintained. It must be called from within the scope of a " { $link with-serialized } " call." } 
 { $examples 
-    { $example "USING: serialize io.streams.string ;" "[\n  [ { 1 2 } dup  (serialize) (serialize) ] with-serialized\n] string-out\n\n[\n  [ (deserialize) (deserialize) ] with-serialized\n] string-in eq? ." "t" }
+    { $example "USING: serialize io.streams.string ;" "[\n  [ { 1 2 } dup  (serialize) (serialize) ] with-serialized\n] with-string-writer\n\n[\n  [ (deserialize) (deserialize) ] with-serialized\n] with-string-reader eq? ." "t" }
 }
 { $see-also (serialize) deserialize serialize with-serialized } ;
 
@@ -26,7 +26,7 @@ HELP: with-serialized
 }
 { $description "Creates a scope for serialization and deserialization operations. The quotation is called within this scope. The scope is used for maintaining the structure and object references of serialized objects." } 
 { $examples 
-    { $example "USING: serialize io.streams.string ;" "[\n  [ { 1 2 } dup  (serialize) (serialize) ] with-serialized\n] string-out\n\n[\n  [ (deserialize) (deserialize) ] with-serialized\n] string-in eq? ." "t" }
+    { $example "USING: serialize io.streams.string ;" "[\n  [ { 1 2 } dup  (serialize) (serialize) ] with-serialized\n] with-string-writer\n\n[\n  [ (deserialize) (deserialize) ] with-serialized\n] with-string-reader eq? ." "t" }
 }
 { $see-also (serialize) (deserialize) serialize deserialize } ;
 
@@ -35,7 +35,7 @@ HELP: serialize
 }
 { $description "Serializes the object to the current output stream. Object references within the structure being serialized are maintained." } 
 { $examples 
-    { $example "USING: serialize io.streams.string ;" "[ { 1 2 } serialize ] string-out\n\n[ deserialize ] string-in ." "{ 1 2 }" }
+    { $example "USING: serialize io.streams.string ;" "[ { 1 2 } serialize ] with-string-writer\n\n[ deserialize ] with-string-reader ." "{ 1 2 }" }
 }
 { $see-also deserialize (deserialize) (serialize) with-serialized } ;
 
@@ -44,6 +44,6 @@ HELP: deserialize
 }
 { $description "Deserializes an object by reading from the current input stream. Object references within the structure that was originally serialized are maintained." } 
 { $examples 
-    { $example "USING: serialize io.streams.string ;" "[ { 1 2 } serialize ] string-out\n\n[ deserialize ] string-in ." "{ 1 2 }" }
+    { $example "USING: serialize io.streams.string ;" "[ { 1 2 } serialize ] with-string-writer\n\n[ deserialize ] with-string-reader ." "{ 1 2 }" }
 }
 { $see-also (serialize) deserialize (deserialize) with-serialized } ;
index e0ecb5393a479301592ad3b6bd6f1c9bb7d993ef..6c80c8de7d484175beed6a7bb3cf8e3ca6d98ba6 100755 (executable)
@@ -38,8 +38,8 @@ C: <serialize-test> serialize-test
 
 : check-serialize-1 ( obj -- ? )
     dup class .
-    dup [ serialize ] string-out
-    [ deserialize ] string-in = ;
+    dup [ serialize ] with-string-writer
+    [ deserialize ] with-string-reader = ;
 
 : check-serialize-2 ( obj -- ? )
     dup number? over wrapper? or [
@@ -47,8 +47,8 @@ C: <serialize-test> serialize-test
     ] [
         dup class .
         dup 2array
-        [ serialize ] string-out
-        [ deserialize ] string-in
+        [ serialize ] with-string-writer
+        [ deserialize ] with-string-reader
         first2 eq?
     ] if ;
 
@@ -63,7 +63,7 @@ C: <serialize-test> serialize-test
         [
             dup (serialize) (serialize)
         ] with-serialized
-    ] string-out [
+    ] with-string-writer [
         deserialize-sequence all-eq?
-    ] string-in
+    ] with-string-reader
 ] unit-test
index aa3641417bb1d2598ad1f4bf488c8aefc7667ef6..33040498912410c48d9da24cc9a502ccadf151da 100755 (executable)
@@ -12,7 +12,7 @@ IN: temporary
 [ { "hello" "." "world" } validate-message ] must-fail
 
 [ "hello\r\nworld\r\n.\r\n" ] [
-    { "hello" "world" } [ send-body ] string-out
+    { "hello" "world" } [ send-body ] with-string-writer
 ] unit-test
 
 [ "500 syntax error" check-response ] must-fail
@@ -20,17 +20,17 @@ IN: temporary
 [ ] [ "220 success" check-response ] unit-test
 
 [ "220 success" ] [
-    "220 success" [ receive-response ] string-in
+    "220 success" [ receive-response ] with-string-reader
 ] unit-test
 
 [ "220 the end" ] [
     "220-a multiline response\r\n250-another line\r\n220 the end"
-    [ receive-response ] string-in
+    [ receive-response ] with-string-reader
 ] unit-test
 
 [ ] [
     "220-a multiline response\r\n250-another line\r\n220 the end"
-    [ get-ok ] string-in
+    [ get-ok ] with-string-reader
 ] unit-test
 
 [
index e15d9511a31ec4c5babcf164f47eb792e4a70c89..d92b4bd48b6d3f66930f9d8712f3a3349f7c364e 100755 (executable)
@@ -72,7 +72,7 @@ SYMBOL: filename
         0 over set-tar-header-size
         0 over set-tar-header-checksum
     ] [
-        [ read-tar-header ] string-in
+        [ read-tar-header ] with-string-reader
         [ tar-header-checksum = [
                 \ checksum-error construct-empty throw
             ] unless
@@ -241,4 +241,4 @@ TUPLE: unimplemented-typeflag header ;
         global [ nl nl nl "Starting to parse .tar..." print flush ] bind
         global [ "Expanding to: " write base-dir get . flush ] bind
         (parse-tar)
-    ] with-file-out ;
+    ] with-file-writer ;
index 75ae377ea7059dd7a094e82204ad9f3d94379b9e..7c28983519de4861da81be95a5d689a8b2fa00d3 100755 (executable)
@@ -18,7 +18,7 @@ MEMO: (vocab-file-contents) ( path -- lines )
 : set-vocab-file-contents ( seq vocab name -- )
     dupd vocab-path+ [
         ?resource-path
-        [ [ print ] each ] with-file-out
+        [ [ print ] each ] with-file-writer
     ] [
         "The " swap vocab-name
         " vocabulary was not loaded from the file system"
index 8fe3b9bdf052e0e8a566909d829c1e84497f000d..833a6e75483468c09752bff855085b06253713e2 100755 (executable)
@@ -20,7 +20,7 @@ M: pair make-disassemble-cmd
         current-process-handle number>string print
         "disassemble " write
         [ number>string write bl ] each
-    ] with-file-out ;
+    ] with-file-writer ;
 
 : run-gdb ( -- lines )
     [
index 8afd9eaa0f7d2aa74fc604ab9551f4b98b99d8e8..644f83c2ca65e873fa55ef7c7fc0ea2fdbfa17ea 100755 (executable)
@@ -81,11 +81,11 @@ IN: temporary
 ] unit-test
 
 [ { "hi\n" } ] [
-    [ [ "hi" print ] string-out ] test-interpreter
+    [ [ "hi" print ] with-string-writer ] test-interpreter
 ] unit-test
 
 [ { "4\n" } ] [
-    [ [ 2 2 + number>string print ] string-out ] test-interpreter
+    [ [ 2 2 + number>string print ] with-string-writer ] test-interpreter
 ] unit-test
 
 [ { 1 2 3 } ] [
@@ -105,7 +105,7 @@ IN: temporary
 [ [ [ 3 throw ] [ 2 * ] recover ] test-interpreter ] unit-test
 
 [ { "{ 1 2 3 }\n" } ] [
-    [ [ { 1 2 3 } . ] string-out ] test-interpreter
+    [ [ { 1 2 3 } . ] with-string-writer ] test-interpreter
 ] unit-test
 
 [ { } ] [
index 0376e7f4c7b21b158027a6f66409b47cf4cfde3d..9b32bc9e10fa6ace95e1427eb7907fb4265ab46b 100755 (executable)
@@ -13,4 +13,4 @@ IN: tools.test.ui
             swap slip
             ungraft notify-queued
         ] with-variable
-    ] string-out print ;
+    ] with-string-writer print ;
index 0e51eaf25a29cbf3a20002ac25e7178bbc7eafe7..de9534ab746c0a48355c9a67a67fc12d91a3a58e 100644 (file)
@@ -27,5 +27,5 @@ testing "testing" "hey" {
 [ "C+x" ] [
     [
         { $command testing "testing" com-test-1 } print-element
-    ] string-out
+    ] with-string-writer
 ] unit-test
index 1e27744f330a99c5e8af335b47c5d61e493367c8..54bae31f795960888e6ff03592bf0a8638e4e52f 100755 (executable)
@@ -191,7 +191,7 @@ M: mock-gadget ungraft*
         ] with-variable ;
 
     { { f f } { f t } { t f } { t t } } [ notify-combo ] assoc-each
-] string-out print
+] with-string-writer print
 
 \ <gadget> must-infer
 \ unparent must-infer
index 248de5e8890a301616c07a5fa5e924942e897d3b..848f7919d3f3d9773bd6ed1bdd4e300b1e36c22f 100755 (executable)
@@ -18,7 +18,7 @@ tools.test.ui models ;
 
 : test-gadget-text
     dup make-pane gadget-text
-    swap string-out "\n" ?tail drop "\n" ?tail drop = ;
+    swap with-string-writer "\n" ?tail drop "\n" ?tail drop = ;
 
 [ t ] [ [ "hello" write ] test-gadget-text ] unit-test
 [ t ] [ [ "hello" pprint ] test-gadget-text ] unit-test
index 930c81dc9bf61ea9de056e0949798a77075a2e64..c4f693c9394bf3c35c3aaf6bec57b01a0ac2dc26 100644 (file)
@@ -10,5 +10,5 @@ tuples ;
 [ "+" ] [
     [
         \ + f \ pprint <command-button> dup button-quot call
-    ] string-out
+    ] with-string-writer
 ] unit-test
index efa1ac3f52ec25236e22c0aac2199051729c1ac7..b7b2224cfa2e29e11b5e06961da11166adffbd19 100755 (executable)
@@ -11,7 +11,7 @@ io.streams.string math help help.markup ;
     3 "op" get operation-command command-quot
 ] unit-test
 
-[ "3" ] [ [ 3 "op" get invoke-command ] string-out ] unit-test
+[ "3" ] [ [ 3 "op" get invoke-command ] with-string-writer ] unit-test
 
 [ drop t ] \ my-pprint [ ] [ editor-string ] f operation construct-boa
 "op" set
@@ -20,9 +20,9 @@ io.streams.string math help help.markup ;
     [
         "4" <editor> [ set-editor-string ] keep
         "op" get invoke-command
-    ] string-out
+    ] with-string-writer
 ] unit-test
 
 [ ] [
-    [ { $operations \ + } print-element ] string-out drop
+    [ { $operations \ + } print-element ] with-string-writer drop
 ] unit-test
index 5a6b146ac25323d5aa74177a52cf8266205b66d9..d44b713e55e5cefe6aea8f87ba0cdc4523ba501b 100644 (file)
@@ -1,3 +1,3 @@
 USING: tools.test io.streams.string xml.generator xml.writer ;
 [ "<html><body><a href=\"blah\"/></body></html>" ]
-[ "html" [ "body" [ "a" { { "href" "blah" } } contained*, ] tag, ] make-xml [ write-item ] string-out ] unit-test
+[ "html" [ "body" [ "a" { { "href" "blah" } } contained*, ] tag, ] make-xml [ write-item ] with-string-writer ] unit-test
index 8c7b51d75677f1cb76adfd57d87d686294005841..28b8f260685d8c6cd6b651d939b52041ec666336 100644 (file)
@@ -108,7 +108,7 @@ M: instruction write-item
     write-xml nl ;\r
 \r
 : xml>string ( xml -- string )\r
-    [ write-xml ] string-out ;\r
+    [ write-xml ] with-string-writer ;\r
 \r
 : with-xml-pprint ( sensitive-tags quot -- )\r
     [\r
index 35280fbee250770bf08d0ea428eb08cfe5fe1753..43940d2f79e044a12215170242b02b1a8081e32d 100644 (file)
@@ -98,7 +98,7 @@ IN: factorbot-commands
     ] if ;
 
 : memory ( text -- )
-    drop [ room. ] string-out multiline-respond ;
+    drop [ room. ] with-string-writer multiline-respond ;
 
 : quit ( text -- )
     drop speaker get "slava" = [ disconnect ] when ;
index 3f8e95c432fcecf6dad1541444013e92d8a28a96..894e7ef97900b4b65a93b37953a9e5698aa816ec 100644 (file)
@@ -72,7 +72,7 @@ M: number tree-write ( char -- ) write1 ;
 
 : farkup ( str -- html )
     'farkup' parse dup nil? 
-    [ error ] [ car parse-result-parsed [ tree-write ] string-out ] if ;
+    [ error ] [ car parse-result-parsed [ tree-write ] with-string-writer ] if ;
 
 ! useful debugging code below
 
@@ -83,4 +83,4 @@ M: number tree-write ( char -- ) write1 ;
 : farkup-parsed ( wiki -- all-parses )
     ! for debugging and optimization only
     'farkup' parse list>array 
-    [ parse-result-parsed [ tree-write ] string-out ] map ;
\ No newline at end of file
+    [ parse-result-parsed [ tree-write ] with-string-writer ] map ;
\ No newline at end of file
index 3c1d43c6f21ee38867c6f4b2500075e48fb82bdf..a015659c0f7a3c354d7b739bc5ca6ba95758cb22 100644 (file)
@@ -148,13 +148,13 @@ DEFER: name>user
     [ httpd ] in-thread drop ;
 
 : onigiri-dump ( path -- )
-    <file-writer> [
+    [
         [
             entry get-global serialize
             meta get-global serialize
             user get-global serialize
         ] with-serialized
-    ] with-stream ;
+    ] with-file-writer ;
 
 : onigiri-boot ( path -- )
     <file-reader> [
index 43ba7b6cec90661eac6467af6171aebc62fbe47b..faeca551c0007757a31d04cfc3b1addde85888f0 100644 (file)
@@ -4,9 +4,9 @@ IN: temporary
 SYMBOL: mmap "mmap-test.txt" \ mmap set\r
 \r
 [ \ mmap get delete-file ] catch drop\r
-\ mmap get <file-writer> [\r
+\ mmap get [\r
     "Four" write\r
-] with-stream\r
+] with-file-writer\r
 \r
 \ mmap get [\r
     >r CHAR: R r> mmap-address 3 set-alien-unsigned-1\r