]> gitweb.factorcode.org Git - factor.git/commitdiff
io.streams.memory: adding with-memory-reader.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 19 Jun 2012 00:24:21 +0000 (17:24 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 19 Jun 2012 00:24:21 +0000 (17:24 -0700)
basis/environment/windows/windows.factor
core/io/streams/memory/memory.factor
extra/tokyo/utils/utils.factor

index ae12482e95431abecfdc19c84cd2b1e5592134b6..dbadff376196e9e0f9e509679f1e0b08df86e188 100644 (file)
@@ -26,8 +26,8 @@ M: windows unset-os-env ( key -- )
 
 M: windows (os-envs) ( -- seq )
     GetEnvironmentStrings [
-        <memory-stream> [
+        [
             utf16n decode-input
             [ "\0" read-until drop dup empty? not ] [ ] produce nip
-        ] with-input-stream*
+        ] with-memory-reader
     ] [ FreeEnvironmentStrings win32-error=0/f ] bi ;
index 9099b620e4f80217c5e06fbab472f4a610931952..9e07143839f93905e64e1f17c2c9362c4215a080 100644 (file)
@@ -15,3 +15,6 @@ M: memory-stream stream-element-type drop +byte+ ;
 M: memory-stream stream-read1
     [ 1 over <displaced-alien> ] change-alien drop
     0 alien-unsigned-1 ; inline
+
+: with-memory-reader ( alien quot -- )
+    [ <memory-stream> ] dip with-input-stream* ; inline
index 2b589e4a4b102eb405b75f3cb27cc7b9f8eebb0d..d18039ec72c8e4e8cf4d83453873f871bea4edaf 100644 (file)
@@ -3,8 +3,5 @@
 USING: io io.streams.memory serialize kernel ;
 IN: tokyo.utils
 
-: with-memory-reader ( memory quot -- )
-    [ <memory-stream> ] dip with-input-stream* ; inline
-
 : memory>object ( memory -- object )
     [ deserialize ] with-memory-reader ;