Handbook
Glossary
>alist ( assoc -- newassoc )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Associative mapping protocol
Prev:
assoc-size ( assoc -- n )
Next:
set-at ( value key assoc -- )
Vocabulary
assocs
Inputs
assoc
an
assoc
Outputs
newassoc
an array of key/value pairs
Generic word contract
Converts an associative structure into an association list.
Definition
IN:
assocs
GENERIC:
>alist
( assoc -- newassoc )
Methods
USING:
accessors
assocs
xml.data
;
M:
attrs
>alist
alist>>
;
USING:
accessors
assocs
biassocs
;
M:
biassoc
>alist
from>>
>alist
;
USING:
accessors
assocs
cache
;
M:
cache-assoc
>alist
assoc>>
[
value>>
]
{
}
assoc-map-as
;
USING:
assocs
;
M:
enumerated
>alist
;
inline
USING:
assocs
env
environment
kernel
;
M:
env
>alist
drop
os-envs
>alist
;
USING:
arrays
assocs
hashtables
hashtables.private
;
M:
hashtable
>alist
[
2array
]
collect-pairs
;
USING:
accessors
assocs
xmode.keyword-map
;
M:
keyword-map
>alist
assoc>>
>alist
;
USING:
accessors
assocs
dlists
linked-assocs
;
M:
linked-assoc
>alist
dlist>>
dlist>sequence
;
USING:
accessors
assocs
kernel
mirrors
slots.private
;
M:
mirror
>alist
[
object-slots
]
[
object>>
]
bi
[
[
offset>>
]
]
dip
[
swap
slot
]
curry
compose
[
[
[
name>>
]
]
]
dip
[
bi
]
curry
compose
map>alist
;
USING:
accessors
assocs
kernel
sequences.n-based
sequences.n-based.private
;
M:
n-based-assoc
>alist
[
n-based-keys
]
[
seq>>
]
bi
zip
;
USING:
accessors
assocs
classes
classes.tuple
kernel
named-tuples
slots.private
;
M:
named-tuple
>alist
dup
class-of
all-slots
[
[
offset>>
slot
]
[
name>>
]
bi
swap
]
with
map>alist
;
USING:
accessors
arrays
assocs
kernel
pairs
sequences
;
M:
pair
>alist
[
hash>>
>alist
]
[
[
key>>
]
[
value>>
]
bi
2array
]
bi
suffix
;
inline
USING:
accessors
assocs
make
persistent.hashtables
persistent.hashtables.nodes
;
M:
persistent-hash
>alist
[
root>>
>alist%
]
{
}
make
;
USING:
assocs
quadtrees
quadtrees.private
;
M:
quadtree
>alist
quadtree>alist
;
USING:
assocs
kernel
redis
;
M:
redis
>alist
[
"*"
redis-keys
dup
redis-mget
zip
]
with-redis
;
USING:
assocs
sequences
;
M:
sequence
>alist
;
inline
USING:
accessors
alien
arrays
assocs
classes.struct.prettyprint
classes.struct.prettyprint.private
continuations
kernel
sequences
;
M:
struct-mirror
>alist
object>>
[
[
drop
"underlying"
]
[
>c-ptr
]
bi
2array
1array
]
[
[
struct>assoc
[
[
[
name>>
]
[
type>>
]
bi
2array
]
dip
]
assoc-map
]
curry
[
drop
{
}
]
recover
]
bi
append
;
USING:
accessors
assocs
kernel
xml.data
;
M:
tag
>alist
[
attrs>>
]
call
\
>alist
execute
;
USING:
arrays
assocs
kernel
sequences
tokyo.abstractdb
;
M:
tokyo-abstractdb
>alist
[
tokyo-abstractdb-keys
dup
]
keep
[
[
dup
]
]
dip
[
at
2array
]
curry
compose
map!
drop
;
USING:
arrays
assocs
kernel
sequences
tokyo.remotedb
;
M:
tokyo-remotedb
>alist
[
tokyo-remotedb-keys
dup
]
keep
[
[
dup
]
]
dip
[
at
2array
]
curry
compose
map!
drop
;
USING:
accessors
assocs
make
trees
trees.private
;
M:
tree
>alist
[
root>>
(node>alist)
]
{
}
make
;
USING:
accessors
assocs
grouping
sequences
vlists
;
M:
valist
>alist
vlist>>
2
<groups>
[
{
}
like
]
map
;
USING:
accessors
assocs
hashtables.wrapped
kernel
sequences
;
M:
wrapped-hashtable
>alist
underlying>>
>alist
[
[
0
swap
[
underlying>>
]
change-nth
]
each
]
keep
;