 (defn var->thing
 
   [{:keys [groupid artifactid version]} var]
-  ;; FIXME: get the ns, name out of the var & make a :def thing
+  {:pre [(string? groupid)
+         (string? artifactid)
+         (string? version)
+         (var? var)]}
   (t/->Def groupid
            artifactid
            version
            (name (var->ns var))
            (name (var->sym var))))
 
+(defn ns->thing
+
+  [{:keys [groupid artifactid version]} ns-symbol]
+  {:pre [(symbol? ns-symbol)
+         (string? groupid)
+         (string? artifactid)
+         (string? version)]}
+  (t/->Ns groupid
+          artifactid
+          version
+          (name ns-symbol)))
+
 (defn var->src
   "Adapted from clojure.repl/source-fn. Returns a string of the source code for
   the given var, if it can find it. Returns nil if it can't find the source.
 
   Example: (var->src #'clojure.core/filter)"
-  
+
   [v]
   {:pre [(var? v)]}
   (when-let [filepath (:file (meta v))]

  (let [docs (-> (meta var)
                 (assoc  :src  (var->src var)
                         :type (var->type var))
                 (update :name name)
                 (update :ns   ns-stringifier))]
    (api/write-meta config
                    (var->thing config var)

            (read (java.io.PushbackReader. pbr)))
          (str text))))))

(defn ns-stringifier

  [x]
  (cond (instance? clojure.lang.Namespace x)
        ,,(name (ns-name x))
        (string? x)
        ,,x
        (symbol? x)
        ,,(name x)
        :else
        ,,(throw
           (Exception.
            (str "Don't know how to stringify " x)))))

(defn name-stringifier

  [x]
  (cond (symbol? x)
        ,,(name x)
        (string? x)
        ,,x
        :else
        ,,(throw
           (Exception.
