The way I capture the slime output stream is this:
(let ((s *standard-output*)) (defun foo () (format s "Debug output")))
And evaluate it with M-x or by pasting into the REPL itself. That's guaranteed to make foo capture a binding to the slime output stream.
To get your approach to work you need to do:
(let ((bindings (list (cons '*standard-output* *standard-output*)))) (bt:make-thread #'foo :initial-bindings bindings))
That is, the value of *standard-output* needs to be evaluated.
Hope that helps.
Vladimir
2010/12/11 Antony lisp.linux@gmail.com:
Hi
I am trying to use bordeaux threads. Trying to figure out how to make output from a thread function appear in slime instead of the lisp terminal. The lisp I am using is Clozure Common Lisp Version 1.6-r14468M (WindowsX8664)
I beleive I have the latest bordeaux threads
Following is my test code. I hope the intentions are clear.
What am I doing wrong or missing?
Code follows Thanks, -Antony
(asdf:oos 'asdf:load-op :bordeaux-threads)
(format t "~%appearing in slime")
(defun thread-test () (format t "~%appearing in lisp terminal: ~A" (bordeaux-threads:thread-name (bordeaux-threads:current-thread))))
(let ((bindings '((*standard-input* . *standard-input*) (*standard-output* . *standard-output*) (*query-io* . *query-io*) (*trace-output* . *trace-output*)))) ;;is this correct? (dolist (name '("foo" "bar")) (bordeaux-threads:make-thread #'thread-test :name name :initial-bindings bindings)))
Bordeaux-threads-devel mailing list Bordeaux-threads-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/bordeaux-threads-devel