home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / prolog / 1437 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.5 KB

  1. Path: sparky!uunet!mcsun!uknet!qmw-dcs!dc
  2. From: dc@dcs.qmw.ac.uk (Daniel Cohen)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Prolog-WIMP interfacing principles
  5. Message-ID: <1992Jul22.112800.20460@dcs.qmw.ac.uk>
  6. Date: 22 Jul 92 11:28:00 GMT
  7. References: <3545@keele.keele.ac.uk>
  8. Sender: usenet@dcs.qmw.ac.uk (Usenet News System)
  9. Organization: Computer Science Dept, QMW, University of London
  10. Lines: 38
  11. Nntp-Posting-Host: guinness.dcs.qmw.ac.uk
  12.  
  13. In <3545@keele.keele.ac.uk> csa09@seq1.keele.ac.uk (Paul Singleton) writes:
  14.  
  15. >Please can anyone with experience or insight suggest some principles
  16. >for interfacing Prolog programs to WIMP interfaces, i.e. buttons, sliders,
  17. >menus, dialog boxes and all that stuff.  I avoid asserting and retracting
  18. >global state, and try to contain side-effects, and I can't see how to
  19. >employ WIMP features without compromising this style.  Well, I can, but ...
  20.  
  21.  
  22. How about using streams? The connection to the server is a (pair of)
  23. stream(s) down which the program sends commands like
  24. new_window(.....,S) where S will be used as a stream to send commands
  25. to the new window created. In particular, dialog boxes might be built
  26. by creating a window as above and then sending commands like
  27. new_slider(.....,SS) down the stream to the window (S). Each input
  28. object will have one of its arguments a stream with which it can send
  29. messages back to the Prolog program. Of course, you'll need some sort
  30. of parallelism (would co-routining be enough?) or else have to write
  31. some horrible polling system to deal with the messages sent back from
  32. input devices.
  33.  
  34. You'll have guessed I'm used to using a concurrent logic language - the
  35. Strand X-Windows interface works this way. The nice thing about such an
  36. interface is that the only implicit state information and side-effects
  37. are in the X server - the program itself remains clean, with all access
  38. to the WIMP system working via the streams. A procedure cannot access
  39. the WIMP system without being given access to one of the WIMP streams
  40. and no changes need be made to the Prolog database.
  41.  
  42. I have a Strand-Ingres interface that works in the same way - all state
  43. is hidden from client programs. Although the interface doesn't fit
  44. relation databases into the logic programming model as neatly as some
  45. Prolog database interfaces do, it does seem to be a lot cleaner.
  46.  
  47. Daniel Cohen              Department of Computer Science 
  48. Email: dc@dcs.qmw.ac.uk   Queen Mary and Westfield College
  49. Tel: +44 71 975 5245/4/9  Mile End Road, London E1 4NS, UK
  50. Fax: +44 81 980 6533      ******* Hit the North!!! *******
  51.