bit-manipulator ( offset bits step-quot: ( i mask start-bit -- quot ) combine-quot: ( prev-quot shift-amount next-quot -- quot ) -- quot )


Vocabulary
classes.struct.bit-accessors

Inputs
offsetan object
bitsan object
step-quota quotation with stack effect ( i mask start-bit -- quot )
combine-quota quotation with stack effect ( prev-quot shift-amount next-quot -- quot )


Outputs
quotan object


Definition


:: bit-manipulator
( offset bits step-quot: ( i mask start-bit -- quot ) combine-quot: ( prev-quot shift-amount next-quot -- quot ) -- quot )
offset bits step-quot manipulate-bits
[ 2drop ] [
step-quot combine-quot bit-manipulator
combine-quot ( prev shift next -- quot ) call-effect
] if-zero ; inline recursive