Bug in read-line?

21 views
Skip to first unread message

Michel Salim

unread,
Dec 13, 2008, 4:26:21 AM12/13/08
to Clojure
Using up-to-date clojure and swank-clojure, I've not been able to use
read-line:

- In Emacs (with Slime / swank-clojure), (read-line) never stops
consuming inputs

- Running clojure directly from a terminal console, (read-line) always
returns ""

This exception is also thrown when starting Swank:
user=> Exception in thread "Call-on-write Stream"
java.lang.RuntimeException: java.lang.IllegalArgumentException: No
matching method found: sleep for class java.lang.Class
at clojure.lang.AFn.run(AFn.java:42)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.IllegalArgumentException: No matching method
found: sleep for class java.lang.Class
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:48)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at swank.util.io$call_on_flush_stream__153$fn__164.invoke(io.clj:31)
at clojure.lang.AFn.run(AFn.java:38)
... 1 more

These might be two unrelated bugs: one in Clojure and one in Swank.
Has anyone encountered them before?

Thanks,

--
Michel

Michel Salim

unread,
Dec 13, 2008, 10:57:25 AM12/13/08
to Clojure


On Dec 13, 4:26 am, Michel Salim <michel.syl...@gmail.com> wrote:
> Using up-to-date clojure and swank-clojure, I've not been able to use
> read-line:
>
> - In Emacs (with Slime / swank-clojure), (read-line) never stops
> consuming inputs
>
> - Running clojure directly from a terminal console, (read-line) always
> returns ""
The terminal case, as it turns out, is what happens if I invoke
clojure using java -jar clojure.jar instead of java -cp clojure.jar
clojure.lang.Repl . Not sure what's causing the Swank problems though.

--
Michel

Stephen C. Gilardi

unread,
Dec 13, 2008, 2:15:51 PM12/13/08
to clo...@googlegroups.com
I'm looking at the terminal case. It's the difference between running
clojure.lang.Repl and clojure.main (which runs a repl by default). The
reading done by the latter is intended to be identical to the reading
done by the former but isn't in the case of read-line. If anyone sees
the fix before I find it, please let me know.

--Steve


On Dec 13, 2008, at 10:57 AM, Michel Salim <michel...@gmail.com>
wrote:

Michel Salim

unread,
Dec 14, 2008, 11:17:54 AM12/14/08
to Clojure
I've not had time to look at the source yet, but want to note that the
exception with Swank happens at r1158:

r1158 | rhickey | 2008-12-12 21:37:12 -0500 (Fri, 12 Dec 2008) | 2
lines

force instance member interpretation of (.method ClassName), e.g.
(.getMethods String) works

Any idea how this could break Swank? Reverting to r1157 (thank you,
git-svn) fixed the problem for now.

Thanks,

--
Michel


On Dec 13, 2:15 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote:
> I'm looking at the terminal case. It's the difference between running  
> clojure.lang.Repl and clojure.main (which runs a repl by default). The  
> reading done by the latter is intended to be identical to the reading  
> done by the former but isn't in the case of read-line. If anyone sees  
> the fix before I find it, please let me know.
>
> --Steve
>
> On Dec 13, 2008, at 10:57 AM, Michel Salim <michel.syl...@gmail.com>  
Reply all
Reply to author
Forward
0 new messages