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