Say I have got following two case classes: case class Address(street: String, city: String, state: String, zipCode: Int)
I am creating trees of s-expressions for a genetic programming problem, and need to alter parts of the trees during the evolution process. I came across the Clojure zipper function that seems like it
Suppose I want to change the orange node in the following tree. So, the only other change 开发者_如何学编程I\'ll need to make is in the left pointer of the green node.
I think that the zipper is a beautiful idea; it elegantly provides a way to walk a list or tree and make what appear to be local updates in a functional way.