Handbook
Glossary
assoc
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Associative mapping protocol
Next:
assoc? ( object -- ? )
Vocabulary
assocs
Class description
A mixin class whose instances are associative mappings. Custom implementations of the assoc protocol should be declared as instances of this mixin for all assoc functionality to work correctly:
INSTANCE: avl-tree assoc
Definition
USING:
biassocs
cache
classes.struct.prettyprint
env
hashtables
hashtables.wrapped
linked-assocs
mirrors
named-tuples
pairs
quadtrees
redis
sequences
sequences.n-based
tokyo.abstractdb
tokyo.remotedb
trees
vlists
xml.data
xmode.keyword-map
zim
;
IN:
assocs
MIXIN:
assoc
INSTANCE:
sequence
assoc
INSTANCE:
enumerated
assoc
INSTANCE:
hashtable
assoc
INSTANCE:
wrapped-hashtable
assoc
INSTANCE:
biassoc
assoc
INSTANCE:
mirror
assoc
INSTANCE:
struct-mirror
assoc
INSTANCE:
linked-assoc
assoc
INSTANCE:
cache-assoc
assoc
INSTANCE:
attrs
assoc
INSTANCE:
tag
assoc
INSTANCE:
keyword-map
assoc
INSTANCE:
named-tuple
assoc
INSTANCE:
valist
assoc
INSTANCE:
tree
assoc
INSTANCE:
env
assoc
INSTANCE:
pair
assoc
INSTANCE:
quadtree
assoc
INSTANCE:
redis
assoc
INSTANCE:
n-based-assoc
assoc
INSTANCE:
tokyo-abstractdb
assoc
INSTANCE:
tokyo-remotedb
assoc
INSTANCE:
zim
assoc
Methods
USING:
assocs
kernel
yaml.private
;
M:
assoc
(deref-aliases)
[
[
(deref-aliases)
]
bi-curry@
bi
]
withd
assoc-map!
;
USING:
assocs
kernel
yaml.private
;
M:
assoc
(replace-aliases)
swap
[
swap
?replace-aliases
]
curry
[
bi@
]
curry
assoc-map
;
USING:
assocs
kernel
yaml.private
;
M:
assoc
(replace-anchors)
swap
[
swap
?replace-anchors
]
curry
[
bi@
]
curry
assoc-map
;
USING:
accessors
assocs
kernel
mongodb.msg
sequences
;
M:
assoc
<mdb-insert-msg>
[
mdb-insert-msg
new
]
2dip
[
>>collection
]
dip
[
V{
}
clone
]
dip
suffix!
>>objects
OP_Insert
>>opcode
;
USING:
assocs
bencode
kernel
sequences
;
M:
assoc
>bencode
[
[
>bencode
]
bi@
append
]
{
}
assoc>map
concat
"d"
"e"
surround
;
USING:
accessors
assocs
http
http.client.post-data
kernel
;
M:
assoc
>post-data
"application/x-www-form-urlencoded"
<post-data>
swap
>>params
;
USING:
assocs
formatting
kernel
sequences
splitting
txon
txon.private
;
M:
assoc
>txon
>alist
[
first2
[
encode-value
]
[
>txon
]
bi*
"%s:`%s`"
sprintf
]
map
join-lines
;
USING:
assocs
inspector
inspector.private
kernel
namespaces
sequences
;
M:
assoc
add-numbers
+number-rows+
get
[
[
prefix
]
map-index
]
when
;
USING:
assocs
kernel
namespaces
yaml
yaml.config
yaml.private
;
M:
assoc
apply-merge-keys
[
[
?apply-merge-keys
]
bi-curry@
bi
]
withd
assoc-map!
merge
get
[
?apply-merge-key
]
when
value
get
[
?apply-default-key
]
when
;
USING:
assocs
kernel
;
M:
assoc
assoc-clone-like
over
[
assoc-size
]
[
new-assoc
]
[
assoc-union!
]
tri*
;
inline
USING:
assocs
kernel
;
M:
assoc
assoc-like
drop
;
inline
USING:
assocs
containers
;
M:
assoc
clone-like
assoc-clone-like
;
USING:
assocs
containers
;
M:
assoc
contains?
key?
;
USING:
assocs
containers
;
M:
assoc
count
assoc-size
;
USING:
assocs
assocs.extras
kernel
;
M:
assoc
delete-value-at
[
value-at*
]
1check
[
delete-at
]
[
2drop
]
if
;
USING:
assocs
combinators.extras
kernel
namespaces
yaml.config
yaml.ffi
yaml.private
;
M:
assoc
emit-value
[
drop
YAML_MAP_TAG
implicit-tags
get
emit-assoc-start
]
[
nip
emit-assoc-body
]
[
2drop
emit-assoc-end
]
4tri
;
USING:
assocs
inspector.private
;
M:
assoc
fix-slot-names
>alist
;
USING:
assocs
benchmark.dispatch3
kernel
;
M:
assoc
g
drop
"assoc"
;
USING:
assocs
containers
;
M:
assoc
items
>alist
;
USING:
assocs
kernel
;
M:
assoc
keys
[
drop
]
{
}
assoc>map
;
USING:
assocs
containers
;
M:
assoc
like
assoc-like
;
USING:
assocs
containers
;
M:
assoc
lookup
at
;
USING:
assocs
mirrors
;
M:
assoc
make-mirror
;
USING:
assocs
kernel
yaml.private
;
M:
assoc
merge-value
over
assoc-diff
assoc-union!
;
USING:
assocs
hashtables
kernel
;
M:
assoc
new-assoc
drop
<hashtable>
;
inline
USING:
assocs
kernel
persistent.assocs
;
M:
assoc
new-at
clone
[
set-at
]
keep
;
USING:
assocs
kernel
persistent.assocs
;
M:
assoc
pluck-at
clone
[
delete-at
]
keep
;
USING:
assocs
io
json.prettyprint.private
kernel
namespaces
sequences
;
M:
assoc
pprint-json*
dup
assoc-empty?
[
drop
"{ }"
write
]
[
"{"
print
indent-level
inc
>alist
[
","
print
]
[
first2
[
write-spaces
pprint-json*
": "
write
]
[
pprint-json*
]
bi*
]
interleave
nl
indent-level
dec
write-spaces
"}"
write
]
if
;
USING:
assocs
kernel
random
;
M:
assoc
random*
[
>alist
]
dip
random*
;
USING:
assocs
containers
;
M:
assoc
remove-all
clear-assoc
;
USING:
assocs
smalltalk.selectors
;
M:
assoc
selector-at:
at
;
USING:
assocs
kernel
smalltalk.selectors
;
M:
assoc
selector-at:put:
[
swapd
set-at
]
keep
;
USING:
assocs
json
json.private
;
M:
assoc
stream-write-json
write-json-assoc
;
USING:
assocs
kernel
summary
;
M:
assoc
tuple-summary
dup
assoc-size
"entries"
container-summary
;
USING:
assocs
kernel
sequences
;
M:
assoc
unzip
dup
assoc-empty?
[
drop
{
}
{
}
]
[
>alist
flip
first2
]
if
;
USING:
assocs
kernel
;
M:
assoc
value-at*
swap
[
=
nip
]
curry
assoc-find
nip
;
USING:
assocs
kernel
;
M:
assoc
values
[
nip
]
{
}
assoc>map
;
USING:
assocs
cbor
cbor.private
kernel
sequences
;
M:
assoc
write-cbor
dup
length
5
write-integer
[
[
write-cbor
]
bi@
]
assoc-each
;
USING:
assocs
kernel
msgpack
msgpack.private
;
M:
assoc
write-msgpack
dup
assoc-size
write-map-header
[
[
write-msgpack
]
bi@
]
assoc-each
;