{ $description "Applies the quotation to each element of the sequence, and collects the keys and values into a new assoc having the same type as " { $snippet "exemplar" } "." } ;
HELP: map>alist
-{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... key value ) } } { "assoc" "a new assoc" } }
+{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... key value ) } } { "alist" "a new alist" } }
{ $description "Applies the quotation to each element of the sequence, and collects the keys and values into a new alist." } ;
{ map>assoc map>alist } related-words
[ [ swapd set-at ] curry compose each ] keep
] if ; inline
-: map>alist ( ... seq quot: ( ... elt -- ... key value ) exemplar -- ... alist )
+: map>alist ( ... seq quot: ( ... elt -- ... key value ) -- ... alist )
{ } map>assoc ; inline
: extract-keys ( seq assoc -- subassoc )