Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!apple!sun-barr!newstop!sun!quintus!pds From: pds@quintus.UUCP (Peter Schachte) Newsgroups: comp.lang.prolog Subject: Re: A Question of Style Keywords: programming style prolog non-logical Message-ID: <1285@quintus.UUCP> Date: 18 Nov 89 02:46:50 GMT References: <1471@speedy.mcnc.org> <2727@munnari.oz.au> Reply-To: pds@quintus.UUCP (Peter Schachte) Organization: Quintus Computer Systems, Inc. Lines: 22 In article <2727@munnari.oz.au> ok@mudla.cs.mu.OZ.AU (Richard O'Keefe) writes: >The really clean way of doing this would be to use Logix or Strand and have >the sequence of X events present as a list of records (if you try to look >at the next event and it hasn't happened yet the current process is >suspended until it materialises). I've seen a windowing system done in >Logix and was instantly converted: that approach really does work. I suspect that this isn't quite what Peter wanted here. In X, when the server asks you to redraw the contents of a window, you need to clear out the queue of events of any more requests to redraw that window, or you'll redraw multiple times. If that is the problem to be solved here, the approach you suggest wouldn't work, since you only want to look at the events that are already queued. You certainly don't want to suspend when you hit the end of the queue, you just want to return. I have no idea how to do this really cleanly, or if that's possible at all, but I kind of prefer the if-then-else approach to the other two in Peter's original posting. -- -Peter Schachte pds@quintus.uucp ...!sun!quintus!pds