Fixes
parent
984c099de6
commit
d6a1eb0590
|
@ -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
|
||||||
|
|
|
@ -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 -- )
|
||||||
|
|
Loading…
Reference in New Issue