How can one create cyclic (and immutable) data structures in Clojure without extra indirection?
I need to represent directed graphs in Clojure. I'd like to represent each node in the graph as an object (probably a record) that includes a field called :edges that is a collection of the nodes that are directly reachable from the current node. Hopefully it goes without saying, but I would like these graphs to be immutable. I can construct directed acyclic graphs with this approach as long as I do a topological sort and build each graph "from the leaves up". This approach doesn't work for cyclic graphs, however. The one workaround I can think of is to have a separate collection (probably a