-- JaMOtherDefs.mesa -- Last changed by Bill Paxton, March 24, 1981 3:29 PM JaMOtherDefs: DEFINITIONS = BEGIN Name: TYPE = RECORD [local: BOOLEAN, index: [0..77777B]]; Text: TYPE = LONG POINTER TO TEXT; CreateName: PROCEDURE[Text] RETURNS [Name]; TextForName: PROC [Text, Name]; -- fills the text with the characters used to create the name -- generates signal TextOverflow if text too short TextOverflow: SIGNAL [Text] RETURNS [Text]; RegisterCommand: PROCEDURE[text: Text, proc: PROCEDURE]; PushText: PROCEDURE[Text]; PopText: PROCEDURE[Text]; CreateNameFromString: PROCEDURE[str: STRING] RETURNS [Name]; StringForName: PROC [STRING, Name]; -- fills the string with the text used to create the name PushName: PROC [Name]; -- turns the name into an object and pushes it on the operand stack PopName: PROC RETURNS [Name]; -- pops a name object from operand stack and returns the name TryToPopName: PROC RETURNS [Name, BOOLEAN]; -- if top of stack is a name, pops it and returns [name, TRUE] -- else returns [-, FALSE] PopNameOrReal: PROC RETURNS [nameflag: BOOLEAN, name: Name, value: REAL]; -- pops either name or real from operand stack -- nameflag true if top was a name, false if was a real -- converts integer or long integer into real if necessary ExecuteName: PROC [Name] RETURNS [known: BOOLEAN]; -- tries to load the value for name with current dictstk -- if name is known, value goes on execstk and is executed -- (actually calls Execute in JaMExec) -- otherwise, just returns false Obj: TYPE [3]; -- objects are 3 words PushObj: PROCEDURE[Obj]; PopObj: PROCEDURE RETURNS[Obj]; Command: TYPE [1]; -- command has a 1 word representation TryToGetCommand: PROC [Name] RETURNS [Command, BOOLEAN]; -- looks up name in current context -- BOOLEAN is false if name not known or value not a command ExecuteCommand: PROC [Command]; -- calls the command procedure PushCommand: PROC [Command]; -- pushes command on exec stk PushCommandName: PROC [Name]; -- does cvx and pushes on exec stk Go: PROC; -- start the JaM machine. (i.e., call Execute) END. (635)\78b12B23b4B55b4B32b10B35b11B137b12B33b15B42b9B19b7B20b20B42b13B83b8B85b7B87b12B125b13B227b12B233b4B35b7B18b6B26b8B51b15B141b14B49b11B48b15B51b2B