What would be the best way to add data to the rewrite-clj zipper tree (eg. a flag per-node)?
Just use assoc?
Will the zipper then maintain all that information "correctly" though ? At the bottom there must be operations constructing nodes, this will only work if they're doing a merge or something?
don't know about zipper tree
why use zippers in this case and not just postwalk the rewrite-clj nodes?
Basically I was writing a specialized edn editor (all the way back to formatted text), so theres extra state, and I want it to be "stable" under moving nodes, deleting them etc. Rewrite-clj helps me map changes in edn back to changes in (a whitespace-preserving string), but I want my UI state tagged back and stable too. One way I thought was to annotate each node with an ID, then I have two relationship (str->edn) (edn->id) and it's all good, but that will only work if rewrite-clj is happy to maintain e,tea I formation per zipper node
I could also try not using the zipper, I haven't thought it through, I don't think I need to accumulate multiple changes so that efficiency element of zippers is irrelevant
*extra information
I have some time later today to play around. I can't remember if assoc on a node would be problematic when using the zip api.
A concrete example: I have an edn list of strings, in my app runtime that corresponds to a UI component for each string, with state like text-cursor, I perform an operation like deleting one of the strings, now those strings all have different indexes in their parent list, but on my rerender pass I need to tie back to component state per-string the paths are broken so I need IDs
Please don't, I thought someone might just know the answer I'd hate for someone to spend time on it
I can just test it / read the code if noone knows offhand
Happy to try to help if you remain stuck. If you get unstuck, please do share what you came up with so we can all learn from your experience.