Skip to content

Instantly share code, notes, and snippets.

@pbaille
Created February 6, 2017 14:42
Show Gist options
  • Select an option

  • Save pbaille/05682f780a97a9d7bd32a1df5167ff2e to your computer and use it in GitHub Desktop.

Select an option

Save pbaille/05682f780a97a9d7bd32a1df5167ff2e to your computer and use it in GitHub Desktop.
(ns reforms.core.import
(:require [cljs.analyzer.api :as ana-api]))
(defmacro import-vars [[_quote ns]]
`(do
~@(->>
(ana-api/ns-interns ns)
(remove (comp :macro second))
(map (fn [[k# _]]
`(def ~(symbol k#) ~(symbol (name ns) (name k#))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment