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 a namespace. In the absence of that, "main" itself is a decent substitute.

I'd still like to suggest a '-E' flag, which basically specifies
the entry point to call. So one could do

clojure.main -E some.namespace/some-func

I like that. Perhaps we could even leave out the "-E" resolving the namespace/filepath ambiguity by trying the namespace first and if it's not found, trying the filepath.

This would require some.namespace to be on the
classpath.

clojure.main some/file.clj

would just execute some/file.clj as a script.

clojure.main does this one now.

clojure.main -E some.namespace/some-func some/namespace.clj

I like this too.

would first read some/namespace.clj and then execute
some.namespace/some-func. This would not require
some.namespace to be on the classpath, because it could
be defined in the given file.

Right. very flexible.

This would allow to make the loading of script files side-effect
free, which would ease their use during debugging. And it
would allow different entry points in a single script.

Nice benefit.

I like these changes. More discussion, especially from everyone interested in more flexible launching of Clojure via clojure.main would give us an indication of how important a change it is.

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to