db4
Slava Pestov 2008-02-15 19:42:56 -06:00
parent 984c099de6
commit d6a1eb0590
2 changed files with 6 additions and 6 deletions

View File

@ -268,13 +268,13 @@ HELP: remove-all
{ $side-effects "assoc" } ; { $side-effects "assoc" } ;
HELP: substitute-here HELP: substitute-here
{ $values { "assoc" assoc } { "seq" "a mutable sequence" } } { $values { "seq" "a mutable sequence" } { "assoc" assoc } }
{ $description "Replaces elements of " { $snippet "seq" } " which appear as keys in " { $snippet "assoc" } " with the corresponding values, acting as the identity on all other elements." } { $description "Replaces elements of " { $snippet "seq" } " which appear as keys in " { $snippet "assoc" } " with the corresponding values, acting as the identity on all other elements." }
{ $errors "Throws an error if " { $snippet "assoc" } " contains values whose types are not permissible in " { $snippet "seq" } "." } { $errors "Throws an error if " { $snippet "assoc" } " contains values whose types are not permissible in " { $snippet "seq" } "." }
{ $side-effects "seq" } ; { $side-effects "seq" } ;
HELP: substitute HELP: substitute
{ $values { "assoc" assoc } { "seq" sequence } { "seq" sequence } } { $values { "seq" sequence } { "assoc" assoc } { "newseq" sequence } }
{ $description "Creates a new sequence where elements of " { $snippet "seq" } " which appear as keys in " { $snippet "assoc" } " are replaced by the corresponding values, and all other elements are unchanged." } ; { $description "Creates a new sequence where elements of " { $snippet "seq" } " which appear as keys in " { $snippet "assoc" } " are replaced by the corresponding values, and all other elements are unchanged." } ;
HELP: cache HELP: cache

View File

@ -37,10 +37,10 @@ GENERIC: optimize-node* ( node -- node/t changed? )
over assoc-empty? [ over assoc-empty? [
2drop 2drop
] [ ] [
2dup node-in-d substitute-here 2dup node-in-d swap substitute-here
2dup node-in-r substitute-here 2dup node-in-r swap substitute-here
2dup node-out-d substitute-here 2dup node-out-d swap substitute-here
node-out-r substitute-here node-out-r swap substitute-here
] if ; ] if ;
: perform-substitutions ( node -- ) : perform-substitutions ( node -- )