Can I refer another namespace and expose its functions as public for the current ns?

前端 未结 3 1783
傲寒
傲寒 2021-02-01 20:37

I thought use would do it but it seems the mapping created in the current namespace is not public. Here is an example of what I\'d like to achieve:

         


        
3条回答
  •  孤街浪徒
    2021-02-01 21:28

    To pull everything from namespace that may have macros defined within use this

    (defmacro pullall [ns]
      `(do ~@(for [[sym var] (ns-publics ns)]
               `(def ~sym ~var))))
    

提交回复
热议问题