Re: How to see runtime-output of lisp-process ?
- From: Pascal Bourguignon <spam@xxxxxxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 15:51:28 +0200
Marco simon <marco_simon@xxxxxx> writes:
> I'm quite new to lisp an I've still some problems
> with the lisp-handling.
> My current Problem:
> I've got a little application, based on ucw which
> sends the final output (triggered by http-requests)
> to the browser (parsed to html-code).
>
> For testing and debugging-purpose I'd like to set some
> "show me your current value" outputs in the lisp-code
> which give me information about the variables' values.
> (somethin like (print *myvalue*) )
>
> Now my Problem: I write my code in emacs, send it to
> slime for compilation --> the slime-repl shows me some
> compilation info. After that point my code is productive
> and is executed as soon as I visite the Website which
> uses that code. But: I don't know where I can see the Output
> of (print *myvalue*) - the Repl doesn't tell me and I've no
> idea where else I should look for the output.
This is not related to UCW, it's a pure slime problem.
The stream between swank and slime is heavily buffered (probably in
slime, not in swank).
Even with a newline and a FINISH-OUTPUT (or CLEAN-OUTPUT):
; SLIME 2005-07-06
(loop for i from 0 to 10 do
(when (= 5 i) (print :hello) (terpri) (finish-output)) (sleep 1))
won't display :HELLO before the end of the loop.
Alternatives:
- use inferior-lisp, it works nicely.
- open a logging/debugging stream on an xterm, or to somewhere else.
For example in clisp with or without slime:
(with-open-stream (*log* (EXT:MAKE-XTERM-IO-STREAM))
(loop for i from 0 to 10 do
(when (= 5 i) (print :hello *log*)) (sleep 1)))
works perfectly.
- a standard way to do it would be:
M-x shell RET touch /tmp/log ; tail -f /tmp/log RET
and in slime:
(with-open-file (*log* "/tmp/log" :direction :output :if-exists :append)
(loop for i from 0 to 10 do
(when (= 5 i)
(print :hello *log*) (terpri *log*) (finish-output *log*))
(sleep 1)))
--
__Pascal Bourguignon__ http://www.informatimago.com/
The rule for today:
Touch my tail, I shred your hand.
New rule tomorrow.
.
- Follow-Ups:
- Re: How to see runtime-output of lisp-process ?
- From: Brian Downing
- Re: How to see runtime-output of lisp-process ?
- References:
- How to see runtime-output of lisp-process ?
- From: Marco simon
- How to see runtime-output of lisp-process ?
- Prev by Date: Re: Very poor Lisp performance
- Next by Date: Re: Very poor Lisp performance
- Previous by thread: How to see runtime-output of lisp-process ?
- Next by thread: Re: How to see runtime-output of lisp-process ?
- Index(es):
Relevant Pages
|