(defn process-rewrite-form [[k & specs :as form]]
(letfn [(process-spec [maybe-spec]
(let [[lib & xs] (if (sequential? maybe-spec)
maybe-spec
[maybe-spec])]
(if (and (symbol? lib) (aliasable-clj-ns? lib))
(let [lib' (clj-ns->cljs-ns lib)
spec (cons lib' xs)]
(into (if xs [spec] []) [(list lib' :as lib)]))
[maybe-spec])))]
(if (#{:use :require} k)
(cons k (mapcat process-spec specs))
form)))