This looks great :)

A couple of comments below:

On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
[...]
> Here are some examples of using the proposed clojure.main via "java -
> jar clojure.jar":
>
> Display usage info:
>
> % java -jar clojure.jar --help
> Usage: java -jar clojure.jar [option*] [file-arg*] [--] [arg*]

Perhaps this should be:

Usage: java -jar clojure.jar [option*] [file-arg* [-- [arg*]]]

or does it make sense to allow args without file-args?

> options:
>   -h, --help       Print this help message and exit
>   -e, --eval expr  Evaluate an expression and print its value
>   -r, --repl       Run an interactive Read-Eval-Print Loop
>   file             Run code from from file
>   -                Run code from standard input
>
>   With no options, Clojure runs a repl.
[...]

Excellent :)

> Combining eval and repl, demonstrating that the repl can load files
> and see arguments:
>
>        % java -jar clojure.jar -e "\"welcome to the repl\"" --repl init.clj
> -- 1 2 :a :b
>        welcome to the repl
>        hi from init.clj, arguments are ("1" "2" ":a" ":b")
>        Clojure

This "Clojure" seems out of place.  I wonder if it would make sense to
suppress it if the repl is loading stuff, or if "-e" is used?

>        user=> *command-line-args*
>        (1 2 :a :b)
>        user=>
[...]
> Now using a filename, files to load before it, and arguments
>
>        % java -jar clojure.jar script.clj init.clj init2.clj -- a b c
>        hi from init.clj, arguments are ("a" "b" "c")
>        hi from init2.clj, arguments are ("a" "b" "c")
>        hi from script.clj, arguments are ("a" "b" "c")

I think this could just as well load all the files in the order they
appear on the command line.  It seems easier to me to explain "the
files are loaded in order" rather than "the files listed after the
first file are loaded in order, followed by the first file."

> Executing Clojure code piped into standard in:
>
>        % echo "(prn (sort '(:a :z :m :q)))" | java -jar clojure.jar -
>        (:a :m :q :z)

Could you supply command line args here?  If so, I suppose you can
ignore my comment about the Usage.

> The patch also includes a repl written in Clojure in src/clj/clojure/
> main.clj. It supports optional keyword arguments that let you
> customize it quite a bit while defaulting to the familiar behavior of
> java version:

I like it.

-- 
Michael Wood <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to