diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-05-16 20:18:43 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-05-16 20:18:43 +0000 |
commit | dbb85aafafc90a9b6021ef58c5cd4bd8a20600fc (patch) | |
tree | e21a8308865b640816846ab8d7b70fe3ae4595bc /src/clj | |
parent | 939976735ea071cb00944b066392ab8b8d749918 (diff) |
do unrolls at top-level
Diffstat (limited to 'src/clj')
-rw-r--r-- | src/clj/clojure/core.clj | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index a65443da..2f594afc 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -3448,9 +3448,9 @@ (def gen-class) (defmacro with-loading-context [& body] - `((fn this# [] + `((fn loading# [] (. clojure.lang.Var (pushThreadBindings {clojure.lang.Compiler/LOADER - (-> this# .getClass .getClassLoader)})) + (-> loading# .getClass .getClassLoader)})) (try ~@body (finally @@ -3493,13 +3493,16 @@ gen-class-call (when gen-class-clause (list* `gen-class :name (.replace (str name) \- \_) :impl-ns name :main true (next gen-class-clause))) - references (remove #(= :gen-class (first %)) references)] - `(with-loading-context + references (remove #(= :gen-class (first %)) references) + ;ns-effect (clojure.core/in-ns name) + ] + `(do (clojure.core/in-ns '~name) - ~@(when gen-class-call (list gen-class-call)) - ~@(when (and (not= name 'clojure.core) (not-any? #(= :refer-clojure (first %)) references)) - `((clojure.core/refer '~'clojure.core))) - ~@(map process-reference references)))) + (with-loading-context + ~@(when gen-class-call (list gen-class-call)) + ~@(when (and (not= name 'clojure.core) (not-any? #(= :refer-clojure (first %)) references)) + `((clojure.core/refer '~'clojure.core))) + ~@(map process-reference references))))) (defmacro refer-clojure "Same as (refer 'clojure.core <filters>)" |