Hi Daniel,
just to make sure, you are running the repl branch? This should make the communication more robust. However this was mostly tested on diverse flavors of Unix (mainly Solaris). The current code does however take no care how long the lines are that are sent to TCL. If you look into flush-wish, you will find some disabled code to limit the line length sent to TCL. It really sounds as if we should make sure only to send short lines over the pipe.
Peter
On Fri, Feb 19, 2010 at 5:26 AM, dherring@tentpost.com wrote:
Hi Peter,
Thanks for getting back to LTK.
Hmm, Windows is strange :). But your explanation is the best I have
heard for the windows problems so far... so I added
#+mswindows (sleep 1)
The waiting for a prompt has only one problem - tcl doesn't send a prompt when run as a subprocess.
I've poked at this a bit more; the sleep doesn't fix all my problems. It appears that incomplete commands are being flushed to wish and/or ltk is overflowing a stream buffer somewhere. For example, running ltktest with a trace on read-wish, I see errors like
LTK::READ-WISH returned (:ERROR "value for "-textvaria" missing") or Error sending command to wish: on #<BASIC-CHARACTER-OUTPUT-STREAM ISO-8859-1 (PIPE/1092) #x8D5F2BE> : Invalid argument during write or LTK::READ-WISH returned (:ERROR "missing close-brace")
This appears to be a race condition; the error changes randomly with each run (though the above are the most common). Sometimes the test almost works, other times it stops early. I did have to comment out the section which draws the lines -- that almost never worked. Similarly, theme-names generally fails (or whatever else does the first read-wish). For some reason, the situation can be aggravated by adding flush-wish in various places.
But the first sleep at least lets Tk's window appear.
- Daniel
P.S. I'm debugging this in an attempt to get ABLE running.
ltk-user site list ltk-user@common-lisp.net http://common-lisp.net/mailman/listinfo/ltk-user