changed stream>assoc to return the amount of bytes read from the stream
parent
fa8aa747b9
commit
f588143082
|
@ -194,13 +194,7 @@ M: bson-binary-function element-binary-read ( size type -- quot )
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: stream>assoc ( exemplar -- assoc )
|
: stream>assoc ( exemplar -- assoc bytes-read )
|
||||||
<state> dup state
|
<state> dup state
|
||||||
[ read-int32 >>size read-elements ] with-variable
|
[ read-int32 >>size read-elements ] with-variable
|
||||||
result>> ;
|
[ result>> ] [ read>> ] bi ;
|
||||||
|
|
||||||
: array>assoc ( array exemplar -- assoc )
|
|
||||||
[ binary ] dip '[ _ stream>assoc ] with-byte-reader ;
|
|
||||||
|
|
||||||
: array>hashtable ( array -- assoc )
|
|
||||||
H{ } array>assoc ;
|
|
||||||
|
|
Loading…
Reference in New Issue