diff options
Diffstat (limited to 'src/clojure/contrib/repl_utils.clj')
-rw-r--r-- | src/clojure/contrib/repl_utils.clj | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/clojure/contrib/repl_utils.clj b/src/clojure/contrib/repl_utils.clj index 76730aae..f0986a5f 100644 --- a/src/clojure/contrib/repl_utils.clj +++ b/src/clojure/contrib/repl_utils.clj @@ -149,5 +149,22 @@ (let [tref (java.lang.ref.WeakReference. t)] (dosync (commute break-threads assoc (.getId t) tref))))) +;; ---------------------------------------------------------------------- +;; scgilardi at gmail + +(defn run* + "Loads the specified namespace and invokes its \"main\" function with + optional args." + [ns-sym & args] + (require ns-sym :reload-all) + (apply (ns-resolve ns-sym 'main) args)) + +(defmacro run + "Loads the specified namespace and invokes its \"main\" function with + optional args. ns-name is not evaluated." + [ns-name & args] + `(run* '~ns-name ~@args)) + +;; ---------------------------------------------------------------------- (load "repl_utils/javadoc") |