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 ;
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
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 ;