Handbook
Glossary
new-assoc ( capacity exemplar -- newassoc )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Associative mapping protocol
Prev:
value-at* ( value assoc -- key/f ? )
Next:
assoc-like ( assoc exemplar -- newassoc )
Vocabulary
assocs
Inputs
capacity
a non-negative integer
exemplar
an
assoc
Outputs
newassoc
an
assoc
Generic word contract
Creates a new assoc from an
exemplar
which can hold
capacity
entries before growing.
Definition
IN:
assocs
GENERIC:
new-assoc
( capacity exemplar -- newassoc )
Methods
USING:
assocs
hashtables
kernel
;
M:
assoc
new-assoc
drop
<hashtable>
;
inline
USING:
assocs
kernel
vectors
xml.data
;
M:
attrs
new-assoc
drop
<vector>
<attrs>
;
USING:
assocs
kernel
trees.avl
;
M:
avl
new-assoc
2drop
<avl>
;
USING:
assocs
biassocs
hashtables
kernel
;
M:
biassoc
new-assoc
drop
[
<hashtable>
]
[
<hashtable>
]
bi
biassoc
boa
;
USING:
assocs
hashtables
kernel
;
M:
f
new-assoc
drop
<hashtable>
;
inline
USING:
assocs
hashtables.identity
kernel
;
M:
identity-hashtable
new-assoc
drop
<identity-hashtable>
;
USING:
accessors
assocs
dlists
kernel
linked-assocs
;
M:
linked-assoc
new-assoc
assoc>>
new-assoc
<dlist>
linked-assoc
boa
;
USING:
assocs
hashtables.numbers
kernel
;
M:
number-hashtable
new-assoc
drop
<number-hashtable>
;
USING:
assocs
hashtables.sequences
kernel
;
M:
sequence-hashtable
new-assoc
drop
<sequence-hashtable>
;
USING:
assocs
kernel
sequences
vectors
;
M:
sequence
new-assoc
drop
<vector>
;
inline
USING:
assocs
kernel
trees.splay
;
M:
splay
new-assoc
2drop
<splay>
;
USING:
accessors
assocs
kernel
xml.data
;
M:
tag
new-assoc
[
attrs>>
]
call
\
new-assoc
execute
;
USING:
assocs
kernel
trees
;
M:
tree
new-assoc
2drop
<tree>
;