universal main() with repl/script/compile
Hi Eric,
I've been using the repl in clojure,main (which is great, BTW)
but I
Thanks!
have a question as to why the main loop is not a "pure" REPL?
I am able to substitute all parts except that the *in* stream is
mucked with
On Feb 9, 2:10 pm, Thorsen Eric wrote:
> For some reason I could not reply to the original thread...
>
> Begin forwarded message:
>
> > From: "Stephen C. Gilardi"
> > Date: February 6, 2009 12:49:34 PM EST
> > To: Eric Thorsen
> > Subject: Re: Pa
For some reason I could not reply to the original thread...
Begin forwarded message:
> From: "Stephen C. Gilardi"
> Date: February 6, 2009 12:49:34 PM EST
> To: Eric Thorsen
> Subject: Re: Patch: universal main() with repl/script/compile
>
> Hi Eric,
>
>>
On Nov 26, 9:17 pm, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> This is probably more of a Java question than a Clojure question. I'm
> thinking most people will want clojure-contrib in their classpath. I
> tried this using SVN 1127 without success.
>
> java -cp clojure-contrib.jar -jar clojure
This is probably more of a Java question than a Clojure question. I'm
thinking most people will want clojure-contrib in their classpath. I
tried this using SVN 1127 without success.
java -cp clojure-contrib.jar -jar clojure.jar
user=> (require 'clojure.contrib.str_utils)
This gives me a FileNotF
That's great -- happy it's in.
Quick impression: I like the improvements to clojure.main, especially
that forms from stdin & -e are evaluated after init files are loaded &
*command-line-args* is set.
Now that clojure.lang.Compile is official, I'll post a cleaned up
version of my cljc script (but
On Nov 26, 5:13 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> On Nov 24, 2008, at 11:57 AM, Stephen C. Gilardi wrote:
>
> > I've uploaded a patch along those lines:
> > ant-compile-main.patch,http://tinyurl.com/5azp3u
> > based on our recent work on this. This includes Compile.java,
>
On Nov 24, 2008, at 11:57 AM, Stephen C. Gilardi wrote:
> I've uploaded a patch along those lines: ant-compile-main.patch,
> http://tinyurl.com/5azp3u
> based on our recent work on this. This includes Compile.java,
> main.clj, and modifies build.xml.
I've updated this to reflect several of th
> With that in mind, here ( http://bit.ly/17N0M ) is a patch (against
> r1125) that includes all of Stephen & Stuart's additions for the
> clojure.main function, plus the modifications to clojure.lang.Compile
> for checking if the clojure.compile.path sytem property is on the
> classpath. My modifi
Thanks for untangling the Ant black magic, Stefan. Forking a separate
VM seems the simplest way to go.
With that in mind, here ( http://bit.ly/17N0M ) is a patch (against
r1125) that includes all of Stephen & Stuart's additions for the
clojure.main function, plus the modifications to clojure.lang
On 2008-11-25, Perry Trolard <[EMAIL PROTECTED]> wrote:
>> Is the classpath set up in the Ant task? It should look
>> something like this:
>> Near the top:
>>
>> In the compile clojure task:
>> > classpath="${build}:${cljsrc}">
>>
>>
>> ...and s
On Nov 25, 1:42 pm, Perry Trolard <[EMAIL PROTECTED]> wrote:
> Yes, that's the build.xml I have. If I add
>
> err.println(System.getProperty("java.class.path"));
>
> to clojure.lang.Compile, it gives me all of the Ant jars (included
> below, but no need to scrutinize) but neither the $build or $
> Is the classpath set up in the Ant task? It should look
> something like this:
>
> Near the top:
>
>
> In the compile_clojure task:
> classpath="${build}:${cljsrc}">
>
>
> ...and so on...
>
> There have been so many patches on this, I'm not sure
On Nov 25, 11:46 am, Perry Trolard <[EMAIL PROTECTED]> wrote:
> Yeah, I thought of the same, but when I dump the results of
> System.getProperty("java.class.path"), my classes directory doesn't
> show up -- running under the Ant task, on my machine, at least. It
> would if passed as an arg to java
On Tue, Nov 25, 2008 at 12:06 PM, Perry Trolard <[EMAIL PROTECTED]> wrote:
>
> Sorry -- inadvertent send: the Ant task is the first case that's gotta
> work, so I think the best option is to catch the ClassNotFound
> exception, unless there's another alternative I'm not thinking of
I don't have a
Sorry -- inadvertent send: the Ant task is the first case that's gotta
work, so I think the best option is to catch the ClassNotFound
exception, unless there's another alternative I'm not thinking of (&
given my small amount of knowledge of Java proper, the chances of that
are high!).
Perry
--~-
On Nov 25, 8:42 am, Stuart Sierra <[EMAIL PROTECTED]>
wrote:
> I think it's because of different string representations of the path
> (e.g. the path variable may be "./classes" but the classpath (under
> Ant) is "/home/bob/project/classes". It probably need something like
> this:
> ...
Yeah, I
On Nov 24, 7:52 pm, Perry Trolard <[EMAIL PROTECTED]> wrote:
> Right, good idea. It would just take checking to see if the "path"
> variable is in System.getProperty("java.class.path"), right?
...
> Answer: no. I tried the approach below against Stephen's
> clojure.lang.Compile, & the ant build pr
I've written a preliminary cljc script -- a shell script for compiling
Clojure libs -- against Stephen's patched Clojure (specifically using
the clojure.lang.Compile class).
Configure the script with the locations of the clojure.jar & clojure-
contrib.jar & running cljc w/o options calls clojure.
On Nov 24, 4:03 pm, Stuart Sierra <[EMAIL PROTECTED]> wrote:
> Hi Perry, Stephen,
> I like the "convention over configuration"-ness of defaulting to ./
> classes. One thought: Weird errors might result if ./classes is not
> on classpath. Is there an easy way to check that, and display a
> helpf
> On Nov 24, 2008, at 3:31 PM, Perry Trolard wrote:
> > Regarding clojure.lang.Compile: this is incredibly handy! Thanks. What
> > do think about adding a default value to the clojure.compile.path
> > system property (./classes)?
On Nov 24, 3:57 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
On Nov 24, 2008, at 3:31 PM, Perry Trolard wrote:
> Regarding clojure.lang.Compile: this is incredibly handy! Thanks. What
> do think about adding a default value to the clojure.compile.path
> system property (./classes)?
I like it. I'll make that change. There is an underlying default of
"cla
On Mon, Nov 24, 2008 at 9:27 PM, Stephen C. Gilardi <[EMAIL PROTECTED]>wrote:
>
> On Nov 24, 2008, at 1:49 PM, Michael Wood wrote:
>
> This looks great :)
>
>
> Thanks!
>
> A couple of comments below:
>
> On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi <[EMAIL PROTECTED]>
> wrote:
> [...]
>
>
Very cool. The two main use cases work well (REPL, script), & the
others -- loaded files, evaluation -- are real bonuses. (It's also
really nice to have an extensible REPL implemented in Clojure).
I think a flag for file loading (-l, --load) to make clear the
distinction b/w the file that's a scr
On Nov 24, 2008, at 2:28 PM, Stephen C. Gilardi wrote:
>> Usage: java -jar clojure.jar [option*] [file-arg*] [-- [arg*]]
>
> That looks exactly right to me. I'll be adopting that.
On further review, I think this is better:
Usage: java -jar clojure.jar [option*] [file-arg*] [-- arg*]
M
On Nov 24, 2008, at 2:17 PM, J. McConnell wrote:
>
> On Mon, Nov 24, 2008 at 1:49 PM, Michael Wood <[EMAIL PROTECTED]>
> wrote:
>>
>> This looks great :)
>
> Yes, it does!
:-)
>
> I was going to suggest something similar:
>
> Usage: java -jar clojure.jar [option*] [file-arg*] [-- [arg*]]
Tha
On Nov 24, 2008, at 1:49 PM, Michael Wood wrote:
> This looks great :)
Thanks!
> 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
On Mon, Nov 24, 2008 at 1:49 PM, Michael Wood <[EMAIL PROTECTED]> wrote:
>
> This looks great :)
Yes, it does!
> 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":
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: jav
On Nov 23, 2008, at 2:30 PM, Stuart Sierra wrote:
> Hmm, you mean write the REPL in Clojure? I hadn't though of that.
> Intriguing idea. It would be neat if the REPL were just a function,
> so you could start it from within a program using arbitrary input/
> output streams. Something to think
I wanted to say thanks to Stuart & Stephen for taking this on. I think
it'll make the point of entry into Clojure that much easier ("Just
call the jar -- to get the REPL, to run a script, etc.") & I'm looking
forward to it.
Something that came up on another thread was what kind of AOT
compilation
Hi,
Am 23.11.2008 um 20:30 schrieb Stuart Sierra:
Hmm, you mean write the REPL in Clojure? I hadn't though of that.
Intriguing idea. It would be neat if the REPL were just a function,
so you could start it from within a program using arbitrary input/
output streams. Something to think about..
On Nov 23, 2008, at 2:30 PM, Stuart Sierra wrote:
>
> On Nov 22, 3:57 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
>> But... what are we thinking? Along the lines of Rich's suggestion the
>> other day... I'm thinking we should stick to the very simple
>> Compile.java to solve the bootstra
On Nov 22, 3:57 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> But... what are we thinking? Along the lines of Rich's suggestion the
> other day... I'm thinking we should stick to the very simple
> Compile.java to solve the bootstrap problem and then write Main in
> Clojure where it's
On Nov 21, 2008, at 10:33 PM, Stuart Sierra wrote:
> Thanks, Stephen -- good feedback! I fixed [2] and [3]. Not sure
> about [1], maybe it's a line-ending thing. Anyway, this new patch
> (attached) was written on OSX, so it had better work!
> -S
Thanks Stuart! They all worked.
But... what ar
Thanks, Stephen -- good feedback! I fixed [2] and [3]. Not sure
about [1], maybe it's a line-ending thing. Anyway, this new patch
(attached) was written on OSX, so it had better work!
-S
On Nov 21, 5:31 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> On Nov 21, 2008, at 12:34 PM, Stuart
On Nov 21, 2008, at 12:34 PM, Stuart Sierra wrote:
> The attached patch combines Repl, Script, and the lib compiler that
> Stephen G. and I have worked on.
Hi Stuart,
I like the concept very much.
I had a couple of problems in working with the patch:
[1] patch on Mac OS X Leopard rejected the
On Nov 21, 3:58 pm, Jarkko Oranen <[EMAIL PROTECTED]> wrote:
> Please don't remove the line from the build file.
> It's helpful for people who want to use SLIME. SLIME needs the .clj
> files for its "show definition" functionality and it'd be much nicer
> to just be able to uncomment that instead
Really neat!
One request though:
Please don't remove the line from the build file.
It's helpful for people who want to use SLIME. SLIME needs the .clj
files for its "show definition" functionality and it'd be much nicer
to just be able to uncomment that instead of having to figure out what
you n
Hi Rich, everyone,
The attached patch combines Repl, Script, and the lib compiler that
Stephen G. and I have worked on.
$ java -jar clojure.jar -help
Usage: java -jar clojure.jar [options] [file]
Options:
-help This help message
-eval expr Evaluate an expression (may be repeated)
-c
40 matches
Mail list logo