namespaces quotations sequences sequences.private serialize strings
words combinators.short-circuit literals ;
-
IN: bson.writer
-#! Writes the object out to a byte-vector in BSON format
-
<PRIVATE
SYMBOL: shared-buffer
[ 8192 <byte-vector> [ shared-buffer set ] keep ] unless* ; inline
: >le-stream ( x n -- )
- ! >le write
- swap '[ _ swap nth-byte 0 B{ 0 }
- [ set-nth-unsafe ] keep write ] each
- ; inline
+ swap
+ '[ _ swap nth-byte 0 B{ 0 }
+ [ set-nth-unsafe ] keep write ] each ; inline
PRIVATE>