I'm comparing Huet's original paper with Clojure's implementation and trying to figure out why the changes were made. I'm a Clojure novice, so if I'm wrong on my interpretation of the Clojure code, please correct me.
In Huet's paper, the type of a path is (in Ocaml) Top | Node of tree list * path * tree list;;
. In Clojure, there are two additional fields, pnodes
and changed?
. What's the purpose of these fields? Am I right in believing that l
and r
correspond to the first and third entries in Huet's type, and that ppath
is the second?
Huet's zipper uses linked lists throughout (note I'm talking about the Loc type itself, not the data structure the zipper is operating), while in some places, for instance l
, the Clojure implementation uses vectors. Why the change, and what's the implication for the Clojure implementation's time complexity?