Handbook
Glossary
poke ( value n bitstream -- )
Vocabulary
bitstreams
Inputs
value
an
object
n
an
object
bitstream
an
object
Outputs
None
Definition
IN:
bitstreams
GENERIC:
poke
( value n bitstream -- )
Methods
USING:
accessors
bitstreams
bitstreams.private
kernel
math
sequences
;
M::
lsb0-bit-writer
poke
( value n bs -- )
value n
<widthed>
:>
widthed widthed bs
widthed>>
#bits>>
8
swap
-
split-widthed
:>
( byte remainder ) byte bs
widthed>>
|widthed
:>
new-byte new-byte
#bits>>
8
=
[
new-byte
bits>>
bs
bytes>>
push
zero-widthed
bs
widthed<<
remainder
widthed>bytes
[
bs
bytes>>
push-all
]
[
bs
widthed<<
]
bi*
]
[
byte bs
widthed<<
]
if
;