{ $description "Tests if an assoc contains at least one key with the given value." } ;
HELP: delete-at*
-{ $values { "key" "a key" } { "assoc" assoc } { "old" { $maybe "the previous value" } } { "?" boolean } }
+{ $values { "key" "a key" } { "assoc" assoc } { "value/f" { $maybe "the previous value" } } { "?" boolean } }
{ $description "Removes an entry from the assoc and outputs the previous value together with a boolean indicating whether it was present." }
{ $side-effects "assoc" } ;
M: assoc values [ nip ] { } assoc>map ;
-: delete-at* ( key assoc -- old ? )
+: delete-at* ( key assoc -- value/f ? )
[ at* ] 2keep delete-at ;
-: ?delete-at ( key assoc -- old ? )
+: ?delete-at ( key assoc -- value/key ? )
[ ?at ] 2keep delete-at ;
: rename-at ( newkey key assoc -- )