assocs: fix map>alist and docs.
parent
351f51b72e
commit
5dadf77311
|
@ -473,7 +473,7 @@ HELP: map>assoc
|
||||||
{ $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" } "." } ;
|
{ $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
|
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." } ;
|
{ $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
|
{ map>assoc map>alist } related-words
|
||||||
|
|
|
@ -201,7 +201,7 @@ M: assoc values [ nip ] { } assoc>map ;
|
||||||
[ [ swapd set-at ] curry compose each ] keep
|
[ [ swapd set-at ] curry compose each ] keep
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
: map>alist ( ... seq quot: ( ... elt -- ... key value ) exemplar -- ... alist )
|
: map>alist ( ... seq quot: ( ... elt -- ... key value ) -- ... alist )
|
||||||
{ } map>assoc ; inline
|
{ } map>assoc ; inline
|
||||||
|
|
||||||
: extract-keys ( seq assoc -- subassoc )
|
: extract-keys ( seq assoc -- subassoc )
|
||||||
|
|
Loading…
Reference in New Issue