Closed unclebob closed 12 years ago
Urk. That's out-of-date code (and text saying what would be replaced with what). The correct code is:
(cond ...
(and (zip/branch? zipper)
(= (-> zipper zip/down zip/node) '*))
(-> zipper
(zip/replace '(/ 1 (+ 3 (- 0 9999))))
zip/next
helper)
Since the code is complicated, I also added a step-by-step explanation of how the substitution produced the final result.
The text says you want to replace (*) expressions with a more complex expression, but the code replaces (-) expressions. The part that is underlined with ^^^^^ just seems entirely incorrect. e.g. Where did those 55555s come from?