lpb@cs.bham.ac.uk (Luc Beaudoin) writes:
> Organization: School of Computer Science, University of Birmingham, UK
> Date: Wed, 24 Mar 1993 21:33:18 GMT
> Is there a way to examine the saved state of a pop process from outside
> of that process
The only way I know of is to define the process so that whenever it
is suspended you can either resume it normally or resume it with a
special argument that will then be interpreted in the context of the
processes as a way of interrogating the state of the process.
This means that instead of calling suspend (or resume) in a process
you call a general proceed that calls suspend (or resume) and then
checks to see how it has been resumed.
I used this technique around 1984/5 in LIB NEWOBJ (a precursor to
LIB FLAVOURS), which was an object-oriented package (with multiple
inhertance and message sending) that implemented instances as pop-11
processes so that sending a message to an object was mostly a matter
of sending a procedure to be evaluated in the environment of the
process, although a few special cases of messages were handled
differently.
This depended on the use of dynamically scoped variables, with all
the dangers that that implied (minimised by using sections, or very
carefully chosen identifier names).
For details see HELP NEWOBJ and look at the code in LIB NEWOBJ.
Class definitions caused procedures to be compiled that took
appropriate actions when instances were "resumed". The default case
is handled by calling this procedure whenever a process was resumed.
define default_response();
if isword(message) then valof(message)
elseif isprocedure(message) then message();
elseunless islist(message) or isprocess(message) then
mishap(message,1,'BAD MESSAGE')
endif;
enddefine;
Messages in the form of lists were handled by special class-specific
pattern->action rules.
It's not particularly well designed or efficient, though it did
work, and demonstrated a possible way of using processes.
Aaron
--
Aaron Sloman,
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL A.Sloman@cs.bham.ac.uk OR A.Sloman@bham.ac.uk
Phone: +44-(0)21-414-3711 Fax: +44-(0)21-414-4281
|