[mac-lisp-ide] OpenMCL debug output on arbitrary stream?

Gary Byers gb at clozure.com
Sat May 1 19:32:52 UTC 2004



On Sat, 1 May 2004, Duncan Rose wrote:

>
> I'm not sure this is the right forum for this question; here goes
> anyway.
>
> I'm still slowly working on a Cocoa back end for McCLIM. The back end
> is now at a stage where it can run the McCLIM Listener well enough
> (almost!) to be used as a tool to help development. I'd like to be able
> to get the break loop displayed in the Listener (this would be more
> convenient than switching between the McCLIM Listener and the terminal
> / openmcl cocoa listener when errors occurred).
>
> However, I haven't got any ideas on how I'd achieve this. I know this
> is done in the OpenMCL Listener, but I can't see where.
>
> Can anybody provide pointers on how to do this or where to look for an
> existing example where it's done?
>
> -Duncan
>
>

All of the standard streams (*STANDARD-INPUT*, *DEBUG-IO* ...) are
ordinarily SYNONYM-STREAMs to *TERMINAL-IO*.  Presumably, the thread
that's running the McCLIM listener isn't binding *TERMINAL-IO*, so
things like the break loop are writing to/reading from the stream that's
the global value of *TERMINAL-IO*.

Things might get closer to working if the McCLIM Listener thread was
run via something like:

(process-run-function "McCLIM Listener"
  #'(lambda ()
      (let* ((*terminal-io* (stream-for-McCLIM-listener)))
         (mcclim-repl ...))))

That might be better, but:

  1) there may be some problems forcing output often enough.
  2) there -may- be some code somewhere that assumes that
     *TERMINAL-IO* is a two-way-stream and that the composite
     streams are CCL::FD-STREAMs (streams that read from/write
     to Unix file descriptors.)
  3) Any I/O that the break loop does isn't going to be CLIM-aware.

Or, there may other problems that I'm not even thinking about ... my sense
is that this (binding *TERMINAL-IO*) will get you pretty close to what you
want; whether it's all the way there or not is hard to predict ...





More information about the Mac-lisp-ide mailing list