]> gitweb.factorcode.org Git - factor.git/commitdiff
assocs: improve stack effect for delete-at* and ?delete-at.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 23 Aug 2020 20:00:02 +0000 (13:00 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 23 Aug 2020 20:04:48 +0000 (13:04 -0700)
core/assocs/assocs-docs.factor
core/assocs/assocs.factor

index 12f9c5becd08ce639770b3088017c547605fe87e..354d7b01b9341d3edafd374f09f9013fd5439e09 100644 (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" } ;
 
index 7ab32dc83bfb988ceaa94befb5fc89b67e950b04..e6f5594e95e7a980f54dbe03eba1435e973602d8 100644 (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 -- )