versioned_copy implemented in clojure