]> gitweb.factorcode.org Git - factor.git/commitdiff
io.streams.zeros: write only 'n' zeros.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Oct 2012 14:48:51 +0000 (07:48 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Oct 2012 14:48:51 +0000 (07:48 -0700)
extra/io/streams/zeros/zeros.factor

index 6fa5f4984be383f58d247a82b26895963746ad88..2077c64610824db420d5764a2e17232f62011bf0 100644 (file)
@@ -10,7 +10,8 @@ C: <zero-stream> zero-stream
 
 M: zero-stream stream-element-type drop +byte+ ;
 
-M: zero-stream stream-read-unsafe drop [ drop 0 ] map! drop ;
+M: zero-stream stream-read-unsafe
+    drop over head-slice [ drop 0 ] map! drop ;
 
 M: zero-stream stream-read1 drop 0 ;