Re: run macro for executable namespaces

2009-06-03 Thread Stephen C. Gilardi
On Jun 2, 2009, at 9:38 AM, Meikel Brandmeyer wrote: Did you further think about your previous suggestion to provide the functionality of calling a qualified function from the command line of clojure.main? I'd like to see a (:main...) clause supported by ns to name the main entry point for

Re: run macro for executable namespaces

2009-06-02 Thread Adrian Cuthbertson
Thanks Steve! That's very neat. Pretty much a canonical macro example. Adrian. On Tue, Jun 2, 2009 at 5:50 AM, Stephen C. Gilardi squee...@mac.com wrote: Here's a macro I've found useful for loading and running Clojure programs from the REPL:  (defmacro run    Loads the specified namespace

Re: run macro for executable namespaces

2009-06-02 Thread Konrad Hinsen
On 02.06.2009, at 05:50, Stephen C. Gilardi wrote: Here's a macro I've found useful for loading and running Clojure programs from the REPL: (defmacro run Loads the specified namespace and invokes its \main\ function with optional args. ns-name is not evaluated. [ns-name

Re: run macro for executable namespaces

2009-06-02 Thread Stephen C. Gilardi
On Jun 2, 2009, at 3:35 AM, Adrian Cuthbertson wrote: Thanks Steve! That's very neat. Pretty much a canonical macro example. You're welcome! I'm glad you like it. On Jun 2, 2009, at 4:45 AM, Konrad Hinsen wrote: That looks like a perfect candidate for clojure.contrib.repl-utils! Thanks!

Re: run macro for executable namespaces

2009-06-02 Thread Chouser
On Tue, Jun 2, 2009 at 7:49 AM, Stephen C. Gilardi squee...@mac.com wrote: On Jun 2, 2009, at 4:45 AM, Konrad Hinsen wrote: That looks like a perfect candidate for clojure.contrib.repl-utils! Thanks! After a little more discussion, I'd like to put it in there. I'm never sure what the

Re: run macro for executable namespaces

2009-06-02 Thread Meikel Brandmeyer
Hi, Am 02.06.2009 um 13:49 schrieb Stephen C. Gilardi: I see the tradeoffs as: possible negative: - an extra name in the namespace I don't see this as a big negative. I usually stick with the convention that the function is named after the macro with a star added. As in your

Re: run macro for executable namespaces

2009-06-02 Thread Stephen C. Gilardi
On Jun 2, 2009, at 8:59 AM, Chouser wrote: On Tue, Jun 2, 2009 at 7:49 AM, Stephen C. Gilardi squee...@mac.com wrote: On Jun 2, 2009, at 4:45 AM, Konrad Hinsen wrote: That looks like a perfect candidate for clojure.contrib.repl-utils! Thanks! After a little more discussion, I'd like to

Re: run macro for executable namespaces

2009-06-02 Thread Laurent PETIT
2009/6/2 Stephen C. Gilardi squee...@mac.com: On Jun 2, 2009, at 8:59 AM, Chouser wrote: On Tue, Jun 2, 2009 at 7:49 AM, Stephen C. Gilardi squee...@mac.com wrote: On Jun 2, 2009, at 4:45 AM, Konrad Hinsen wrote: That looks like a perfect candidate for clojure.contrib.repl-utils!

Re: run macro for executable namespaces

2009-06-02 Thread Stephen C. Gilardi
On Jun 2, 2009, at 8:59 AM, Chouser wrote: I'm never sure what the etiquette is for adding to other people's files in contrib, but please don't hesitate to add this to repl-utils on my account. Thanks again. I've checked in run*/run to clojure.contrib.repl-utils. Cheers, --Steve

run macro for executable namespaces

2009-06-01 Thread Stephen C. Gilardi
Here's a macro I've found useful for loading and running Clojure programs from the REPL: (defmacro run Loads the specified namespace and invokes its \main\ function with optional args. ns-name is not evaluated. [ns-name args] `(do (require '~ns-name :reload-all)