Re: println from within a thread

2010-11-21 Thread Aaron Cohen
>> >> > Does anybody know how to redirect the output into the repl? >> I actually think the preferred way of doing this is "M-x slime-redirect-inferior-output" or adding to your .emacs: (add-hook 'slime-mode-hook 'slime-redirect-inferior-output) -- You received this message because you are subs

Re: println from within a thread

2010-11-21 Thread HiHeelHottie
Raek, thanks for taking the time to write this detailed explanation. The alter-var-root works like a charm and I think I understand how bound-fn would behave here. For the case where you are using an existing java class that spawns a thread, it seems to me that only alter-var-root would work sinc

Re: println from within a thread

2010-11-21 Thread Ken Wesson
On Sun, Nov 21, 2010 at 7:05 AM, Rasmus Svensson wrote: >    (def my-thread >      (doto (Thread. (bound-fn [] (println "inside thread"))) >        .start)) Strangely enough, if you try this in a NetBeans repl the repl hangs. -- You received this message because you are subscribed to the Google

Re: println from within a thread

2010-11-21 Thread Rasmus Svensson
2010/11/21 HiHeelHottie : > > Does anybody know how to redirect the output into the repl? Thread local bindings are not passed on to new threads. Since you might have multiple connections to the swank server, there might me multiple repls, each one with their own *out*. Most often though, you only

Re: println from within a thread

2010-11-21 Thread HiHeelHottie
Does anybody know how to redirect the output into the repl? On Nov 20, 7:45 pm, HiHeelHottie wrote: > I'm running it from a shell inside emacs and the output appears in > that buffer.  Thanks! > > On Nov 20, 6:44 pm, Ulises wrote: > > > > > > This is how I'm running the test in the slime-connec

Re: println from within a thread

2010-11-20 Thread HiHeelHottie
I'm running it from a shell inside emacs and the output appears in that buffer. Thanks! On Nov 20, 6:44 pm, Ulises wrote: > > This is how I'm running the test in the slime-connect buffer: > > How are you running the swank process? I usually run it as lein swank. > Whenever I print inside a spaw

Re: println from within a thread

2010-11-20 Thread Ulises
> This is how I'm running the test in the slime-connect buffer: How are you running the swank process? I usually run it as lein swank. Whenever I print inside a spawned thread I get the output in the console where I started swank. U -- You received this message because you are subscribed to the

Re: println from within a thread

2010-11-20 Thread HiHeelHottie
M-x slime-redirect-inferior-output returns no inferior lisp process. This is how I'm running the test in the slime-connect buffer: user> (def my-thread (Thread. #(println "inside thread"))) #'user/my-thread user> (.start my-thread) nil user> I was hoping to see inside thread appear in the output

Re: println from within a thread

2010-11-20 Thread HiHeelHottie
I'm using lein swank and doing a slime-connect from within emacs. The repl is in *slime-repl clojure* buffer, but I don't see an *inferior lisp* buffer. Or did you mean that there is some elisp-var tied to the slime buffer. Can you outline how I can find that? I'm also new to emacs. On Nov 20

Re: println from within a thread

2010-11-20 Thread Ken Wesson
With NetBeans, look at the *out* tab (you should have Repl *err* *out* at the bottom of where the repl normally is) for any output you expected, but didn't see, in the repl. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: println from within a thread

2010-11-20 Thread Moritz Ulrich
Are you using slime? If so, take a look at the *inferior lisp* buffer. There is also a elisp-var you can set to redirect the inferior output to the repl. I just don't remember the name ;) On Sat, Nov 20, 2010 at 10:05 PM, HiHeelHottie wrote: > > I'm trying to output a debug string from a thread:

println from within a thread

2010-11-20 Thread HiHeelHottie
I'm trying to output a debug string from a thread: (def my-thread (Thread. #(println "inside thread"))) (.start my-thread) In the repl, I don't see "inside thread" displayed. Am I coding something incorrectly? Any suggestions on how to get debug output from a thread? Thanks. -- You received