Pinkerton, T.B., "UMIST Manual" The University of Michigan Terminal System Manual, 2nd edition, Vol. II, The University of Michigan Computing Center, Ann Arbor, December 1967, pp. 717-764 view details
Extract: MODE OF OPERATION
MODE OF OPERATION
There are two kind of functions: primitives, or machine-language subroutines
that support the system in its environment. The primitives are the basis for the
second type of function, called forms, or named procedures in UMIST storage,
which are character strings written like macro definitions and expanded,
interpretively, when called. When writing a function call, one specifies whether
its value (replacing the call) is to be processed again as part of the input
string (active call), or whether processing is to continue starting with the
portion of the string to the right of the value returned (neutral call).
A single processing cycle is completed when the scanning and evaluating
process reaches the right-hand end of the string.
Sequencing and evaluation in UMIST are inherently recursive: function calls
are evaluated from left to right, but may be nested to any depth in the
arguments of other calls. Each function call is evaluated when, and only when,
all of its arguments have been completely processed. Thus the string being
processed is divided logically into two parts: the active string, consisting of
input text (possibly preceded by inserted functional values) which is yet to be
scanned, and evaluated arguments of function calls which are not completely
ready for evaluation. This mode of operation, based on the completely
interpretive execution of function calls, eliminates the distinction between
program and data.
Extract: SYNTAX
SYNTAX
Each function call in UMIST
has the form of a specially delimited argument list, in which
the name of the function is always the first argument. Calls may be open (a
variable number of arguments) or closed. A function call may be protected from
evaluation by the use of literal delimiters. Another delimiter signals the
right-hand end of the input string. These considerations lead to a syntax in
which there are seven special symbols, whose occurrences are deleted from the
string during syntax scanning and whose presence indicates the beginning or end
of a substring. The character strings enclosed in brackets below are the
UMIST special symbols:
1.
Beginning of neutral function call [ ##( ]
2. Beginning of active function
call [ #( ]
3. End of argument [ , ]
4. End of call [ ) ]
5.
Beginning of literal [ ( ]
6. End of literal [ ) ]
7. End of input
string [ ' ] |
Note that the three beginning-of-substring symbols ##( and #( and ( are
terminated by the occurrence of the same end-of-substring character, ).
UMIST has a "parenthesis
balanced" syntax, in the sense that an occurrence of the right parenthesis
matches only the last previous occurrence of any one of the
beginning-of-substring special symbols. Whenever a literal substring is
encountered, the UMIST
processor removes the enclosing parentheses, but only the outer
set is removed if more than one matching pair occurs. Thus a string initially
protected from evaluation may be evaluated if scanned a second time, and, in
general, evaluation can be controlled to occur the n-th time the substring is
scanned.
Extract: READ STRING AND PRINT STRING
READ STRING AND PRINT STRING
The value of a 'read string' function call
#(RS)
is an input string
accepted from the current input device. The 'print string' function
#
(PS,X)
causes the display of the second argument, here symbolized by X , on
the current output device, and has a null value.
When the UMIST processor is
first given control, and at the end of every processing cycle, the idling
procedure
##(PS,#(RS))
is automatically
loaded as an input string. This procedure first causes a read from the input
device, with the input string becoming the second argument of the 'print string'
call. Thus the string, if any, remaining when the input string has been
completely processed, is finally printed before the idling procedure is again loaded. For example, if the input string
is
#(PS,ABC)'
then after the 'read string' has been evaluated the
processor is scanning the string
##(PS,#(PS,ABC))
and the inner call
produces the output ABC ; the outer call nothing, since the inner 'print string'
has a null value.
Extract: DEFINE, CALL, AND SEGMENT STRING
DEFINE, CALL, AND SEGMENT STRING
Any character string in UMIST
can be given a name and placed in storage, from whence it can be
called by using its name. The null-valued 'define string'
function
#(DS,A,B)
places the string B in storage with the name A. A is
called a form with value B. At most one string can be defined with a given name
at any one time: use of the same name replaces a former definition. The value is
retrieved with the 'call string' function
#(CL,A)
A form name, like a value, is any character string. The only restriction on
length is that of the total string capacity of the processor.
The occurrence of strings in storage is deleted with the 'delete definition'
function
#(DD,Nl,N2,...)
This null-valued function removes the names Nl,N2,... as
forms and discards their values.
Once defined, a form can be "parameterized," or segmented, using the 'segment
string' function:
#(SS,A,X1,X2,...)
This null-valued function scans the
form A , searching for an occurrence of the string X1 as a substring. If X1
matches a part of A , that part is excluded from further matching, creating a
"formal variable," or segment gap. The rest of the form is also compared with X1
to create, if possible, more segment gaps, all of which are assigned the ordinal
value one, identifying the argument matched. The (separate) substrings of the
form not already taken for segment gaps are next scanned with respect to the
string X2 , and any occurrences of the latter substring in A create segment gaps
of ordinal value two, etc.
Thus, the 'define string' and 'segment string' functions together create a
"macro" in which the segment gaps locate the "formal parameters." The "macro" is
expanded by supplying the "actual parameters" in a call on the 'call string'
function mentioned above:
#(CL,A,Y1,Y2,...).
The value of the 'call' is
generated by returning the form A with all the segment gaps of ordinal value
1,2,... replaced by Y1,Y2,... respectively. If extra arguments are given in a
CL, they are ignored. If some are missing, null strings are used as their
values.
Extract: THE EQUAL FUNCTION
THE EQUAL FUNCTION
A decision function is provided for character strings:
#(EQ,A,B,T,F).
If the string A is identical to the string B , then the value of this
function is the fourth argument, T ; otherwise the value is the fifth argument,
F . Since the strings T and F may be any UMIST
procedures, this primitive is the one normally used for
branching.