Skip to content

Instantly share code, notes, and snippets.

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

  • Save pbaille/007ac639fbd178e640d8310397ba2977 to your computer and use it in GitHub Desktop.

Select an option

Save pbaille/007ac639fbd178e640d8310397ba2977 to your computer and use it in GitHub Desktop.
; Copyright (c) 2015 Designed.ly, Marcin Bilski
; The use and distribution terms for this software are covered by the
; Eclipse Public License which can be found in the file LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by the terms of this license.
; You must not remove this notice, or any other, from this software.
(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