Hacker News new | ask | show | jobs
by viraptor 1016 days ago
This is often useful if you're rewriting something that looks like an abstract syntax tree.

> And why would it match the wrong value?

Because you may be searching the tree for something that looks like `(op(const)(const))` to replace it with `(const)`. But that may live many levels deep inside the structure.

Also, from existing names, that seems very close to MapIf (https://resources.wolframcloud.com/FunctionRepository/resour...) just with added recursion.