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

  1. Path: sparky!uunet!mcsun!uknet!keele!csa09
  2. From: csa09@seq1.keele.ac.uk (Paul Singleton)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Prolog-WIMP interfacing principles: clarification
  5. Message-ID: <3586@keele.keele.ac.uk>
  6. Date: 23 Jul 92 10:46:58 GMT
  7. References: <10217@scott.ed.ac.uk>
  8. Organization: University of Keele, England
  9. Lines: 41
  10.  
  11. From article <10217@scott.ed.ac.uk>, by asch@cogsci.ed.ac.uk (Andreas Schoter):
  12.  
  13. > In article <3545@keele.keele.ac.uk> csa09@seq1.keele.ac.uk (Paul Singleton):
  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. > You don't specify what level of abstraction the WIMP features are
  22. > specified at, low level wiget type facilities, or high level packaged
  23. > utilityies, but...
  24.  
  25. I am using Quintus Prolog's ProXT - "a Prolog interface to the Motif widget
  26. set and the X Toolkit (Xt)".  I have no X experience, nor do I really
  27. want it :-) and I am presently puzzling over how to combine it with my
  28. Prolog programming style, which I claim is fairly clean and amenable to
  29. debugging, maintenance, evolution etc.  I carry all program state around
  30. as data structures passed from call to call.  All iteration is done with
  31. recursion, not with e.g. failure-driven backtracking and assert/retract.
  32. I am reluctant to sprinkle imperative X calls throughout my code, and not
  33. sure how to handle events.
  34.  
  35. When I wrote my first SunTools application, in C, I learnt to turn my
  36. program inside out and effectively write a bunch of interrupt routines
  37. which were called by the "Notifier".  Should I do the same with Prolog?
  38. How can I, without global state?
  39.  
  40. I have considered funnelling all events into a pretend "stream", and
  41. organising my program to recursively digest this stream.  Can anyone
  42. advise me, from experience or dogma, on this or other approaches?
  43.  
  44. Can WIMP interfaces be treated declaratively?
  45.  
  46. Paul S.
  47. ----
  48.   __   __    Paul Singleton (Mr)           JANET: paul@uk.ac.keele.cs
  49.  |__) (__    Computer Science Dept.        other: paul@cs.keele.ac.uk
  50.  |  .  __).  Keele University, Newcastle,    tel: +44 (0)782 621111 x7355
  51.              Staffs ST5 5BG, ENGLAND         fax: +44 (0)782 713082
  52.