assocs: improve stack effect for delete-at* and ?delete-at.

master
John Benediktsson 2020-08-23 13:00:02 -07:00
parent 00fc565111
commit a861c4c732
2 changed files with 3 additions and 3 deletions

View File

@ -405,7 +405,7 @@ HELP: value?
{ $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" } ;

View File

@ -128,10 +128,10 @@ M: assoc keys [ drop ] { } assoc>map ;
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 -- )