Skip to content
Christophe Grand edited this page Jul 31, 2017 · 1 revision

Currently gensyms have been tried to isolate namespaces, here is another proposal: hash-munging.

  1. As usual sort deps in dep-order. The roots have no deps other than core clojure namespaces, compute a hash of the source and append that hash to the namespace name.

  2. For their dependents, first replace occurrences of the original namespaces by their hash-munged ones, then compute their own hashes like in step 1.

  3. repeat until no more namespaces left.

This has the advantage of being a deterministic process. It means that if unrelated extensions have the exact same dep it will be loaded only once because the hash would be equal.

Also since the hashing of a namespace captures the hashes of its deps (step 2 being performed prior to hashing) it makes a hash to reflect not only a version of a namespace but the whole configuration of deps.

Clone this wiki locally