changed stream>assoc to return the amount of bytes read from the stream

db4
Sascha Matzke 2009-01-29 13:47:33 +01:00
parent fa8aa747b9
commit f588143082
1 changed files with 3 additions and 9 deletions

View File

@ -194,13 +194,7 @@ M: bson-binary-function element-binary-read ( size type -- quot )
PRIVATE>
: stream>assoc ( exemplar -- assoc )
: stream>assoc ( exemplar -- assoc bytes-read )
<state> dup state
[ read-int32 >>size read-elements ] with-variable
result>> ;
: array>assoc ( array exemplar -- assoc )
[ binary ] dip '[ _ stream>assoc ] with-byte-reader ;
: array>hashtable ( array -- assoc )
H{ } array>assoc ;
[ read-int32 >>size read-elements ] with-variable
[ result>> ] [ read>> ] bi ;