【发布时间】:2015-05-25 05:54:00
【问题描述】:
我有一个包含多个命名空间的库。我希望我可以使核心命名空间中的所有命名空间中的函数都可用。这样我就可以只需要example.core 而不是需要example.ns1、example.ns2 等。
这是我的核心命名空间中的内容
(ns example.core
(:require [example.options :refer :all]
[example.playback :refer :all]
[example.controlls :refer :all]
[example.stored :refer :all]
[example.db :refer :all]))
这就是我试图要求它的方式
(ns test-app.core
(:require [example.core :as e])
(e/foo) ; where foo is defined in one of the namespaces required by example.core
当我尝试执行时,我得到CompilerException java.lang.RuntimeException: No such var: e/foo
我所追求的可能吗?还是我必须单独导入多个命名空间?
感谢您的宝贵时间
【问题讨论】:
标签: clojure namespaces