Changed my mind and fixed this on the Clojure side [1]. Now you should be able to bind *err* to any old Writer you like.

Stu

[1] 
http://github.com/richhickey/clojure/tree/c4eb5719b0f30ea4c113e6e98a1c171c43a01abe

So if someone produces a fork of incanter that doesn't have the
warning (or David fixes up Incanter), then the problem goes away?
Because the other place I see the warnings coming out of is swank
itself.

On Thu, May 6, 2010 at 9:33 AM, Stuart Halloway
<stuart.hallo...@gmail.com> wrote:
This is another variant of the "Swank likes StringWriters, everybody else
likes PrintWriters" problem, see e.g. [1]

I would love to see somebody fix this, and I think it is simpler (and
probably conceptually correct) to make swank use a PrintWriter, instead of
requiring all possible tools to do a check for swank's sake. See [2]

Until this is fixed, swank is busted for any app that produces a
last-var-wins warning.

[1] https://www.assembla.com/spaces/clojure-contrib/tickets/55
[2]
http://groups.google.com/group/clojure-dev/browse_thread/thread/369734ff42cbb06a/adbeb8d031a990d2?lnk=gst&q=printwriter#adbeb8d031a990d2

Update: Using the latest labrepl commit (fa89411ae "use private
compojure snapshot"), I'm now able to pull in incanter and use it
(albeit with tons of warnings about group-by and flatten from both
incanter and swank)...but only if I use script/repl via inferior- lisp.
I still can't get swank to work. It fails with the same error as
before [1].

But at least I'm unblocked.

[1]
swank.util.io.proxy$java.io.StringWriter$0 cannot be cast to
java.io.PrintWriter
 [Thrown class java.lang.ClassCastException]

Restarts:
0: [ABORT] Return to SLIME's top level.

Backtrace:
 0: clojure.lang.Namespace.warnOnReplace(Namespace.java:85)
 1: clojure.lang.Namespace.reference(Namespace.java:106)
 2: clojure.lang.Namespace.refer(Namespace.java:164)
 3: clojure.core$refer__4606.doInvoke(core.clj:3175)
 4: clojure.lang.RestFn.invoke(RestFn.java:411)
 5: clojure.lang.AFn.applyToHelper(AFn.java:163)
 6: clojure.lang.RestFn.applyTo(RestFn.java:133)
 7: clojure.core$apply__3769.invoke(core.clj:537)
 8: clojure.core$load_lib__5243.doInvoke(core.clj:4693)
 9: clojure.lang.RestFn.applyTo(RestFn.java:143)
10: clojure.core$apply__3769.invoke(core.clj:537)
11: clojure.core$load_libs__5259.doInvoke(core.clj:4712)
12: clojure.lang.RestFn.applyTo(RestFn.java:138)
13: clojure.core$apply__3769.invoke(core.clj:539)
14: clojure.core$use__5283.doInvoke(core.clj:4792)
15: clojure.lang.RestFn.invoke(RestFn.java:409)
16: user$eval__9709.invoke(NO_SOURCE_FILE:1)
17: clojure.lang.Compiler.eval(Compiler.java:5344)
18: clojure.lang.Compiler.eval(Compiler.java:5312)
19: clojure.core$eval__4343.invoke(core.clj:2362)
20: swank.commands.basic$eval_region__677.invoke(basic.clj:40)
21: swank.commands.basic$eval_region__677.invoke(basic.clj:31)
22: swank.commands.basic $eval__690$listener_eval__691.invoke(basic.clj:54)
23: clojure.lang.Var.invoke(Var.java:365)
24: user$eval__9707.invoke(Unknown Source)
25: clojure.lang.Compiler.eval(Compiler.java:5344)
26: clojure.lang.Compiler.eval(Compiler.java:5312)
27: clojure.core$eval__4343.invoke(core.clj:2362)
28: swank.core$eval_in_emacs_package__324.invoke(core.clj:59)
29: swank.core$eval_for_emacs__387.invoke(core.clj:128)
30: clojure.lang.Var.invoke(Var.java:373)
31: clojure.lang.AFn.applyToHelper(AFn.java:169)
32: clojure.lang.Var.applyTo(Var.java:482)
33: clojure.core$apply__3769.invoke(core.clj:535)
34: swank.core$eval_from_control__326.invoke(core.clj:66)
35: swank.core$eval_loop__328.invoke(core.clj:71)
36: swank.core $spawn_repl_thread__438$fn__468$fn__469.invoke(core.clj:183)
37: clojure.lang.AFn.applyToHelper(AFn.java:159)
38: clojure.lang.AFn.applyTo(AFn.java:151)
39: clojure.core$apply__3769.invoke(core.clj:535)
40: swank.core$spawn_repl_thread__438$fn__468.doInvoke(core.clj:180)
41: clojure.lang.RestFn.invoke(RestFn.java:398)
42: clojure.lang.AFn.run(AFn.java:24)
43: java.lang.Thread.run(Thread.java:636)

--
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
Note that posts from new members are moderated - please be patient with
your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

--
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
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

--
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
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

--
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to