clj-commons / potemkin

some ideas which are almost good
572 stars 53 forks source link

Allow to import all vars from a namespace when no vars are specified #30

Closed mpenet closed 10 years ago

mpenet commented 10 years ago

Hi Zach,

I was wondering if you could extend import-vars to allow something like that:

(import-vars [some-ns] [some-other-ns vars] ...)

where some-ns would have all it's vars aliased

I am using the following macro to work around this now:

(defmacro import-all-vars
  [namespace]
  `(potemkin/import-vars
    [~namespace
     ~@(map key (ns-publics (the-ns namespace)))]))
ztellman commented 10 years ago

I think I'd prefer to keep it explicit, so I'd suggest to just use your workaround where you want to import everything.