Handbook
Glossary
bit-reader ( offset bits -- quot: ( alien -- n ) )
Vocabulary
classes
.
struct
.
bit-accessors
Inputs
offset
an
object
bits
an
object
Outputs
quot
a
quotation
with stack effect
( alien -- n )
Definition
USING:
alien.accessors
kernel
math
;
IN:
classes.struct.bit-accessors
:
bit-reader
( offset bits -- quot: ( alien -- n ) )
[
neg
'[
_
alien-unsigned-1
_
bitand
_
shift
]
]
[
swap
'[
_
_
bi
_
shift
bitor
]
]
bit-manipulator
;