io.streams.memory: adding with-memory-reader.
parent
7a10a8eb0d
commit
752b5c6887
|
@ -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 ;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue