Here's an approach that might work...

; app1.clj
(ns app1)
(defn myinc[x] (inc x))
(defn mydec[x] (dec x))
(defn .....)

;app2.clj
(ns app2)
(defn mysq[x] (* x x))

then you have a mylib.clj which is your public "user" module;

(ns mylib)
(require 'app1 'app2)
(defn exports[]
  (refer 'app1 :only '(myinc mydec)) ; for e.g
  (refer 'app2))

Then your users use it as follows;

(require 'mylib)
(mylib/exports)

(myinc 2)
3
(mydec 1)
0
(mysq 2)
4

You could wrap the require/exports in a macro and pass in the ns-symbol.

-Regards, Adrian


On Wed, Aug 18, 2010 at 1:21 PM, Nicolas Oury <nicolas.o...@gmail.com> wrote:
> If you intern all the ns-public variable of a namespace, they will be
> reexoprted?
>
> Will there be an indirection at runtime or the JVM can sort that out?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to