Description
Problem/Opportunity
At times we need to automate changes which requires us to repeatedly (inside code) search for values and make changes. Now while doing that operation on config.edn (or for any other type), after first search, once the zipper location is inside a deeply nested map, there's a problem in searching for brothers of current-location's grandfather or great-grandfather.
This is tough when you don't even know at what level (grandfather or great-grandfather or above that) is the next search item located.
Proposed Solution
There should be a method in zip API to either:
- a method to move the zipper to top so that I don't have to do that manually for the next search
- OR a method to move the zipper to a custom position, say [2, 13]. Though, I'm not sure how useful this would be
- OR a find function which lets you search from the beginning instead of the current location
Alternative Solutions
I've written my own function to go up continuously till a certain key is found. I begin my successive searches from there on.
Additional context
Let me know if you need some concrete examples.
Action
I'm happy to contribute a PR with whatever solution the maintainers agree on.
Metadata
Assignees
Type
Projects
Status
Medium Priority