Welcome! Please see the About page for a little more info on how this works.

+4 votes
in Clojure by
retagged ago by

When I traverse a nested structure with a zipper, modify a node deep inside and want to get the whole updated structure back, each time I visit an ancestor node of the modified one, my make-node function is unnecessarily called 3 times by the clojure.zip/next function.

Reviewing the implementation of the next function, I see that storing the result of (up p) in a variable/binding would get me rid of the extra make-node calls (and I have tested that it does).

I identified this issue in a Clojurescript REPL but it looks like it's present in the Clojure implementation, too.

1 Answer

+1 vote
ago by

I logged as https://clojure.atlassian.net/browse/CLJ-2896. If you want to provide a patch, you can follow the process at https://clojure.org/dev/dev#_becoming_a_contributor to become a contributor.

...