From duncan at robotcat.demon.co.uk Sat May 1 20:09:02 2004 From: duncan at robotcat.demon.co.uk (Duncan Rose) Date: Sat, 1 May 2004 21:09:02 +0100 Subject: [mac-lisp-ide] OpenMCL debug output on arbitrary stream? Message-ID: <63D08F58-9BAB-11D8-B4EF-000A9577B8A2@robotcat.demon.co.uk> 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 From gb at clozure.com Sat May 1 19:32:52 2004 From: gb at clozure.com (Gary Byers) Date: Sat, 1 May 2004 13:32:52 -0600 (MDT) Subject: [mac-lisp-ide] OpenMCL debug output on arbitrary stream? In-Reply-To: <63D08F58-9BAB-11D8-B4EF-000A9577B8A2@robotcat.demon.co.uk> References: <63D08F58-9BAB-11D8-B4EF-000A9577B8A2@robotcat.demon.co.uk> Message-ID: <20040501131949.A2117@clozure.com> 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 ...