Handbook
Glossary
bit-set
Factor handbook
»
The language
»
Collections
»
Sets
»
Set implementations
»
Bit sets
Next:
<bit-set> ( capacity -- bit-set )
Vocabulary
bit-sets
Class description
The class of bit-array-based
Sets
.
Definition
USING:
bit-arrays
;
IN:
bit-sets
TUPLE:
bit-set
{
table
bit-array
read-only
initial:
?{
}
}
;
Methods
USING:
accessors
bit-sets
kernel
sequences
sets
;
M:
bit-set
adjoin
[
t
]
2dip
table>>
set-nth
;
USING:
accessors
bit-sets
math.bitwise
sets
;
M:
bit-set
cardinality
table>>
bit-count
;
USING:
accessors
bit-sets
kernel
;
M:
bit-set
clone
table>>
clone
bit-set
boa
;
USING:
accessors
bit-sets
kernel
math
sequences
sets
;
M:
bit-set
delete
over
integer?
[
[
f
]
2dip
table>>
?set-nth
]
[
2drop
]
if
;
USING:
bit-sets
bit-sets.private
math
sets
;
M:
bit-set
diff
[
bitnot
bitand
]
bit-set-op
;
USING:
accessors
bit-sets
kernel
math
sequences
sets
;
M:
bit-set
in?
over
integer?
[
table>>
?nth
]
[
2drop
f
]
if
;
inline
USING:
bit-sets
bit-sets.private
math
sets
;
M:
bit-set
intersect
[
bitand
]
bit-set-op
;
USING:
accessors
bit-sets
kernel
sequences
sequences.private
sets
;
M:
bit-set
members
table>>
[
length
<iota>
]
keep
[
nth-unsafe
]
curry
filter
;
USING:
accessors
bit-sets
kernel
sequences
sets
;
M:
bit-set
set-like
over
bit-set?
[
2dup
[
table>>
length
]
same?
]
[
f
]
if
[
drop
]
[
[
members
]
dip
table>>
length
<bit-set>
[
adjoin-all
]
keep
]
if
;
inline
USING:
bit-sets
kernel
sets
;
M:
bit-set
subset?
[
intersect
]
keep
=
;
USING:
bit-sets
bit-sets.private
math
sets
;
M:
bit-set
union
[
bitor
]
bit-set-op
;