Handbook
Glossary
bit-array
Bit arrays
Next:
bit-array? ( object -- ? )
Vocabulary
bit-arrays
Class description
The class of fixed-length bit arrays.
Definition
USING:
byte-arrays
sequences.private
;
IN:
bit-arrays
TUPLE:
bit-array
{
length
array-capacity
read-only
initial:
0
}
{
underlying
byte-array
read-only
initial:
B{
}
}
;
Methods
USING:
bit-arrays
prettyprint.custom
;
M:
bit-array
>pprint-sequence
;
USING:
alien
bit-arrays
bit-arrays.private
sequences
;
M:
bit-array
byte-length
length
bits>bytes
;
inline
USING:
bit-arrays
bit-arrays.private
;
M:
bit-array
clear-bits
0
(set-bits)
;
inline
USING:
accessors
bit-arrays
kernel
;
M:
bit-array
clone
[
length>>
]
[
underlying>>
clone
]
bi
bit-array
boa
;
inline
USING:
accessors
bit-arrays
kernel
math
math.bitwise
sequences
;
M:
bit-array
equal?
over
bit-array?
[
2dup
2length
dupd
=
[
[
[
underlying>>
]
bi@
]
dip
8
mod
[
sequence=
]
[
[
[
unclip-slice
]
bi@
swapd
]
dip
[
bits
]
curry
bi@
=
[
sequence=
]
[
2drop
f
]
if
]
if-zero
]
[
3drop
f
]
if
]
[
2drop
f
]
if
;
USING:
accessors
bit-arrays
sequences
;
M:
bit-array
length
length>>
;
inline
USING:
bit-arrays
kernel
sequences
;
M:
bit-array
like
drop
dup
bit-array?
[
>bit-array
]
unless
;
inline
USING:
bit-arrays
bit-vectors
kernel
sequences
;
M:
bit-array
new-resizable
drop
<bit-vector>
;
inline
USING:
bit-arrays
kernel
sequences
;
M:
bit-array
new-sequence
drop
<bit-array>
;
inline
USING:
bit-arrays
bit-arrays.private
kernel
math
sequences.private
;
M:
bit-array
nth-unsafe
bit-index
nth-unsafe
swap
bit?
;
inline
USING:
bit-arrays
prettyprint.custom
;
M:
bit-array
pprint*
pprint-object
;
USING:
bit-arrays
kernel
prettyprint.custom
;
M:
bit-array
pprint-delims
drop
\
?{
\
}
;
USING:
accessors
bit-arrays
bit-arrays.private
byte-arrays
kernel
sequences.private
;
M:
bit-array
resize
dupd
[
bits>bytes
]
[
underlying>>
]
bi*
resize-byte-array
bit-array
boa
zero-end-bits
;
inline
USING:
bit-arrays
bit-arrays.private
;
M:
bit-array
set-bits
-1
(set-bits)
;
inline
USING:
bit-arrays
bit-arrays.private
sequences.private
;
M:
bit-array
set-nth-unsafe
bit-index
[
toggle-bit
]
change-nth-unsafe
;
inline