Handbook
Glossary
set
Factor handbook
»
The language
»
Collections
»
Sets
Next:
set? ( object -- ? )
Vocabulary
sets
Class description
The class of all sets. Custom implementations of the set protocol should be declared as instances of this mixin for all set implementation to work correctly.
Definition
USING:
bit-sets
hash-sets
hash-sets.wrapped
linked-sets
sequences
;
IN:
sets
MIXIN:
set
INSTANCE:
sequence
set
INSTANCE:
hash-set
set
INSTANCE:
bit-set
set
INSTANCE:
wrapped-hash-set
set
INSTANCE:
linked-set
set
Methods
USING:
kernel
sets
yaml.private
;
M:
set
(deref-aliases)
[
members
(deref-aliases)
]
[
clear-set
]
[
swap
union!
]
tri
;
USING:
kernel
sets
yaml.private
;
M:
set
(replace-aliases)
[
members
(replace-aliases)
]
keep
set-like
;
USING:
kernel
sets
yaml.private
;
M:
set
(replace-anchors)
[
members
?replace-anchors
]
keep
set-like
;
USING:
kernel
sets
;
M:
set
?adjoin
2dup
in?
[
2drop
f
]
[
adjoin
t
]
if
;
USING:
kernel
sets
;
M:
set
?delete
2dup
in?
[
delete
t
]
[
2drop
f
]
if
;
USING:
containers
sets
;
M:
set
add
adjoin
;
USING:
kernel
sets
;
M:
set
all-unique?
drop
t
;
USING:
sequences
sets
;
M:
set
cardinality
members
length
;
USING:
kernel
sequences
sets
;
M:
set
clear-set
[
members
]
keep
[
delete
]
curry
each
;
USING:
containers
sets
;
M:
set
contains?
in?
;
USING:
containers
sets
;
M:
set
count
cardinality
;
USING:
kernel
sets
sets.private
;
M:
set
diff
[
(diff)
]
keep
set-like
;
USING:
kernel
sets
;
M:
set
duplicates
drop
f
;
USING:
combinators.extras
kernel
sets
yaml.conversion
yaml.private
;
M:
set
emit-value
[
drop
YAML_SET_TAG
f
emit-assoc-start
]
[
nip
emit-set-body
]
[
2drop
emit-assoc-end
]
4tri
;
USING:
sets
;
M:
set
fast-set
;
USING:
kernel
sets
sets.private
;
M:
set
intersect
[
(intersect)
]
keep
set-like
;
USING:
sequences
sets
sets.private
;
M:
set
intersects?
small/large
sequence/tester
any?
;
USING:
containers
sets
;
M:
set
items
members
;
USING:
containers
sets
;
M:
set
like
set-like
;
USING:
mirrors
sets
;
M:
set
make-mirror
members
make-mirror
;
USING:
kernel
sets
;
M:
set
null?
cardinality
0
=
;
inline
USING:
kernel
random
sets
;
M:
set
random*
[
members
]
dip
random*
;
USING:
containers
sets
;
M:
set
remove
delete
;
USING:
containers
sets
;
M:
set
remove-all
clear-set
;
USING:
kernel
sets
;
M:
set
set-like
drop
;
inline
USING:
kernel
sets
sets.private
;
M:
set
set=
2dup
[
cardinality
]
bi@
=
[
(subset?)
]
[
2drop
f
]
if
;
USING:
kernel
math
sets
sets.private
;
M:
set
subset?
2dup
[
cardinality
]
bi@
>
[
2drop
f
]
[
(subset?)
]
if
;
USING:
kernel
sets
summary
;
M:
set
tuple-summary
dup
cardinality
"members"
container-summary
;
USING:
kernel
sets
sets.private
;
M:
set
union
[
(union)
]
keep
set-like
;