Hi,
for debugging I'd like to print some output to the LispWorks listener from a running (mp) process.
Googling didn't help me and GMAME search on lisp-hug group doesn't work at the moment. I can't
remember how to do this a the moment.
Does anybody know an answer or a reference?
Andreas
Andreas Thiele wrote:
> Hi,
>
> for debugging I'd like to print some output to the LispWorks listener from a running (mp) process.
> Googling didn't help me and GMAME search on lisp-hug group doesn't work at the moment. I can't
> remember how to do this a the moment.
>
> Does anybody know an answer or a reference?
>
No reference, but one way is to create a var bound to
*standard-output* of the listener, then write all output
to this stream.
In the listener do,
CL-USER 1 > *standard-output*
#<EDITOR::RUBBER-STREAM #<EDITOR:BUFFER CAPI interactive-pane 2>>
CL-USER 2 > (defvar *process-output* *standard-output*)
*PROCESS-OUTPUT*
CL-USER 3 > *process-output*
#<EDITOR::RUBBER-STREAM #<EDITOR:BUFFER CAPI interactive-pane 2>>
CL-USER 4 >
In your process do either
(write <some-output> :stream cl-user::*process-output*)
or within the process somewhere on the stack
(let ((*standard-output* cl-user::*process-output*))
continuing code....
(write <some-output>))
Wade
On Tue, 16 Aug 2005 11:26:24 +0200, "Andreas Thiele" <··········@nospam.com> wrote:
> for debugging I'd like to print some output to the LispWorks
> listener from a running (mp) process. Googling didn't help me and
> GMAME search on lisp-hug group doesn't work at the moment. I can't
> remember how to do this a the moment.
>
> Does anybody know an answer or a reference?
In addition to Wade's reply see Nick Levine's chapter about threads in
the CL cookbook, especially this part:
<http://cl-cookbook.sourceforge.net/process.html#output>
Note that #. trick which is nifty for debugging but of course not
usable for production code.
Cheers,
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
"Andreas Thiele" <··········@nospam.com> wrote:
>Hi,
>
>for debugging I'd like to print some output to the LispWorks listener from a running (mp) process.
>Googling didn't help me and GMAME search on lisp-hug group doesn't work at the moment. I can't
>remember how to do this a the moment.
You could put the following somewhere in your code and print to
*listener-output*:
(mp:process-send
(mp:find-process-from-name "CAPI Execution Listener 1")
`(,(lambda ()
(setf *listener-output* *standard-output*))))
Francis
>
>Does anybody know an answer or a reference?
>
>Andreas
>