Following today's SVN updates to the Clojure Core and Contrib (as of
this writing, at 17:42 PST, which is GMT -8), I can no longer invoke the
Contrib REPL as I was able to before today. When I do, I get no prompt
until I type a non-empty line, after which I'm presented with an
unending repetition of this:
java.lang.IllegalArgumentException: Wrong number of args passed to: repl-ln$read-hook
My launcher script does this when I request invocation of the Contrib REPL:
% java -cp "..." clojure.main --init /home/rschulz/.clojure/user.clj -e '(use 'clojure.contrib.repl-ln)' -e '(repl)'
So, what is the correct way to invoke the Contrib REPL now?
By the way, the stock REPL works as expected.
Randall Schulz
Following today's SVN updates to the Clojure Core and Contrib (as of
this writing, at 17:42 PST, which is GMT -8), I can no longer invoke the
Contrib REPL as I was able to before today. When I do, I get no prompt
until I type a non-empty line, after which I'm presented with an
unending repetition of this:
Now I'm dumped back to my shell prompt following a single Clojure REPL
prompt (of the Contrib REPL variety) without even touching the
keyboard:
% clojure-svn --crepl +cp=$PROJ_SRC/tau/run +cp=/dar/clojure
1:1 user=>
%
> --Steve
Randall Schulz
Now I'm dumped back to my shell prompt following a single Clojure REPL
prompt (of the Contrib REPL variety) without even touching the
keyboard:
% clojure-svn --crepl +cp=$PROJ_SRC/tau/run +cp=/dar/clojure
1:1 user=>
%
I can't replicate that:
% java -cp /repo/JT/clojure-svn/clojure/clojure.jar:/repo/JT/clojure-svn/clojure-contrib/clojure-contrib.jar clojure.contrib.repl_ln
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/contrib/repl_ln
Caused by: java.lang.ClassNotFoundException: clojure.contrib.repl_ln
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: clojure.contrib.repl_ln. Program will exit.
Please accept that all the path names are correct, I checked carefully
and more than once and both Clojure Core and Contrib are up-to-date with
the current SVN (as of this writing, of course).
Anyway, I guess it needs to be pointed that the invocation you supplied
won't work unless the Clojure Contrib JAR file is built with pre-
compiled Java classes and that this only happens if you supply the
clojure.jar property ("-Dclojure.jar=path/to/clojure.jar") to your Ant
invocation when you build Clojure Contrib.
Once I figured that out, the problem went away.
Is this documented anywhere?
> ...
>
> --Steve
Randall Schulz
> Anyway, I guess it needs to be pointed that the invocation you
> supplied
> won't work unless the Clojure Contrib JAR file is built with pre-
> compiled Java classes and that this only happens if you supply the
> clojure.jar property ("-Dclojure.jar=path/to/clojure.jar") to your Ant
> invocation when you build Clojure Contrib.
>
> Once I figured that out, the problem went away.
>
> Is this documented anywhere?
I'm not aware of it being documented anywhere.
I've added clojure.contrib.repl-ln/stream-repl to support something
like your original invocation:
% java -cp clojure.jar:clojure-contrib.jar clojure.main -e "(use
'clojure.contrib.repl-ln) (stream-repl)"
This works whether or not clojure-contrib.jar contains compiled code.
--Steve