(FILECREATED "19-Nov-84 17:32:33" {AZTEC}<TRILLIUM>BIRTHDAY84>RERELEASE>TRI-RUN.;2 41337  

      changes to:  (FNS SENSE.FRAME)

      previous date: "24-Aug-84 15:42:38" {AZTEC}<TRILLIUM>BIRTHDAY84>RERELEASE>TRI-RUN.;1)


(* Copyright (c) 1984 by Xerox Corporation)

(PRETTYCOMPRINT TRI-RUNCOMS)

(RPAQQ TRI-RUNCOMS [(FNS ACTION.DONOTHING ACTION.PRINT ACTION.SPEAK ACTIVATE.DISPLAYERS 
			 ACTIVATE.DISPLAYERS* ACTIVATE.IMPLICATIONS ACTIVATE.IMPLICATIONS* 
			 ACTIVATE.INHIBITORS ACTIVATE.INHIBITORS* ACTIVATE.INITIALIZATIONS 
			 ACTIVATE.INITIALIZATIONS* ACTIVATE.SENSORS ACTIVATE.SENSORS* ADD.THERM 
			 ADD.TO.FRAME.CONTEXT* BITMAP.HEIGHT BITMAP.WIDTH BUILD.STACK.OPERATION 
			 CHANGE.CELL CHANGE.CURRENT.VALUE DECREASE.CELL DEFAULT.IMPLY.FN 
			 DEFAULT.INHIBIT.FN DEFAULT.INITIALIZE.FN DEFAULT.SENSE.FN DIFF.THERM 
			 DISABLE.TIMEOUT DO.FRAME.CHANGE DO.POP.CELL DO.PUSH.CELL FIND.CELL 
			 FLOAT.DIGIT.CELL FRAME.DO.GOTO FRAME.DO.POP FRAME.DO.PUSH FRAME.GOTO 
			 FRAME.POP FRAME.POP.EVAL FRAME.PUSH FRAME.PUSH.EVAL IMPLY.ITEM INCREASE.CELL 
			 INHIBIT.ITEM INITIALIZE.ITEM LENGTH.OF.CELL MACHINE.STATE.CREATE 
			 MARK.FRAME.CONTEXT.OBSOLETE NEW.STACK NEXT.DECIMAL.DIGIT.CELL 
			 NEXT.DIGIT.CELL NTH.OF.CELL POP.CELL POP.FROM.CELL PUSH.CELL PUSH.TO.CELL 
			 RESTORE.INTERFACE.CONTEXT RESTORE.INTERFACE.CONTEXT.IF.NECESSARY SENSE.FRAME 
			 SENSE.ITEM SET.CELL SET.CURRENT.VALUE SET.FRAME.CONTEXT 
			 SET.FRAME.CONTEXT.IF.NECESSARY SET.NTH.OF.CELL SETUP.TRACING 
			 SHOW.TRACE.CHANGE SHOW.TRACE.FROM.CELL SHOW.TRACE.NO.CHANGE SHOW.TRACE.PAUSE 
			 SHOW.TRACE.STREAK SHOW.TRACE.TO.CELL START.FRAME START.TIMEOUT SYNC.CLOCK 
			 TRILLIUM.DISMISS TRILLIUM.PAUSE TRILLIUM.STACK TRILLIUM.TRACE.FIND.REGION 
			 TRILLIUM.TRACE.MACHINE.WINDOW TRILLIUM.TRACE.SETUP)
	(VARS REPORT.FRAMES TRILLIUM.BEING.CAREFUL TRILLIUM.KNOWS.LISP (TRILLIUM.TRACE)
	      (TRILLIUM.TRACE.WINDOW)
	      (CHANGE.FRAME.SPECIFICATIONS))
	(UGLYVARS TRILLIUM.TRACE.STREAK.BITMAP TRILLIUM.TRACE.LINE.BITMAP)
	(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS
		  (ADDVARS (NLAMA)
			   (NLAML START.TIMEOUT SET.NTH.OF.CELL SET.CELL PUSH.TO.CELL PUSH.CELL 
				  POP.FROM.CELL POP.CELL NTH.OF.CELL NEXT.DIGIT.CELL 
				  NEXT.DECIMAL.DIGIT.CELL LENGTH.OF.CELL FRAME.PUSH FRAME.POP 
				  FRAME.GOTO FLOAT.DIGIT.CELL DISABLE.TIMEOUT CHANGE.CELL 
				  ACTION.SPEAK ACTION.PRINT)
			   (LAMA])
(DEFINEQ

(ACTION.DONOTHING
  [LAMBDA NIL NIL])

(ACTION.PRINT
  [NLAMBDA (STRING)                                          (* HaKo "16-Aug-84 16:20")
    (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE (EVAL STRING])

(ACTION.SPEAK
  [NLAMBDA (FILE.NAME)                                       (* DAHJr "23-JUN-83 16:11")
    NIL])

(ACTIVATE.DISPLAYERS
  [LAMBDA (FRAME CELL.NAME)                                  (* HaKo "27-Jul-84 16:34")
    (PROG (T1 T2 DISPLAYERS.TO.ON DISPLAYERS.TO.OFF ITEM)
          (SETQ DISPLAYERS.TO.ON (LIST NIL))
          (SETQ DISPLAYERS.TO.OFF (LIST NIL))
          [for DISPLAYER in (GET.FIELDQ FRAME DISPLAYERS FRAME)
	     when [OR (NULL CELL.NAME)
		      (EQ CELL.NAME (CAR DISPLAYER))
		      (AND (LISTP (CAR DISPLAYER))
			   (MEMBER CELL.NAME (CAR DISPLAYER]
	     do (COND
		  [(EQUAL (GET.FIELDQ (CADR DISPLAYER)
				      \TYPE)
			  (QUOTE INDICATOR))
		    (SETQ ITEM (CADR DISPLAYER))
		    [SETQ T1 (EQP (GET.PARAMQ ITEM REFERENCE.VALUE)
				  (GET.CURRENT.VALUE (GET.PARAMQ ITEM CELL]
		    (SETQ T2 (EQ (GET.PARAMQ ITEM ON/OFF)
				 (QUOTE ON)))
		    (COND
		      ((AND T1 (NOT T2))
			(TCONC DISPLAYERS.TO.ON ITEM))
		      ((AND (NOT T1)
			    T2)
			(TCONC DISPLAYERS.TO.OFF ITEM]
		  (T (DISPLAY.ITEM (CADR DISPLAYER)
				   FRAME]
          [for DISPLAYER in (CAR DISPLAYERS.TO.OFF) do (COND
							 (DISPLAYER (DISPLAY.ITEM DISPLAYER FRAME]
          (for DISPLAYER in (CAR DISPLAYERS.TO.ON) do (COND
							(DISPLAYER (DISPLAY.ITEM DISPLAYER FRAME])

(ACTIVATE.DISPLAYERS*
  [LAMBDA (FRAME CELL.NAME DONT.TRACE)                       (* DAHJr "13-Apr-84 19:27")
    (DECLARE (GLOBALVARS FRAME.ALL.DISPLAYERS TRILLIUM.TRACE))
    (SET.FRAME.CONTEXT.IF.NECESSARY FRAME)
    (COND
      (CELL.NAME (for DISPLAYER in FRAME.ALL.DISPLAYERS when [OR (EQ CELL.NAME (CAR DISPLAYER))
								 (AND (LISTP (CAR DISPLAYER))
								      (MEMBER CELL.NAME (CAR 
											DISPLAYER]
		    do                                       (* Since INDICATORS can be more than just EQ, let 
							     INVERTing them deal with the overlapping problem for 
							     now)
		       (AND TRILLIUM.TRACE (NULL DONT.TRACE)
			    (SHOW.TRACE.FROM.CELL CELL.NAME (CADR DISPLAYER)))
		       (DISPLAY.ITEM (CADR DISPLAYER)
				     FRAME)))
      (T (for DISPLAYER in FRAME.ALL.DISPLAYERS
	    do                                               (* Since INDICATORS can be more than just EQ, let 
							     INVERTing them deal with the overlapping problem for 
							     now)
	       (AND TRILLIUM.TRACE (NULL DONT.TRACE)
		    (SHOW.TRACE.FROM.CELL CELL.NAME (CADR DISPLAYER)))
	       (DISPLAY.ITEM (CADR DISPLAYER)
			     FRAME])

(ACTIVATE.IMPLICATIONS
  [LAMBDA (FRAME CELL.NAME OLD.VALUE NEW.VALUE DONT.TRACE)   (* edited: " 1-NOV-82 11:34")
    (for IMPLICATION in (GET.FIELDQ FRAME IMPLICATIONS FRAME)
       when [OR (EQ CELL.NAME (CAR IMPLICATION))
		(AND (LISTP (CAR IMPLICATION))
		     (MEMBER CELL.NAME (CAR IMPLICATION]
       do (IMPLY.ITEM (CADR IMPLICATION)
		      OLD.VALUE NEW.VALUE DONT.TRACE])

(ACTIVATE.IMPLICATIONS*
  [LAMBDA (FRAME CELL.NAME OLD.VALUE NEW.VALUE DONT.TRACE)   (* DAHJr "19-APR-83 21:47")
    (DECLARE (GLOBALVARS FRAME.ALL.IMPLICATIONS TRILLIUM.TRACE))
    (SET.FRAME.CONTEXT.IF.NECESSARY FRAME)
    (for IMPLICATION in FRAME.ALL.IMPLICATIONS when [OR (EQ CELL.NAME (CAR IMPLICATION))
							(AND (LISTP (CAR IMPLICATION))
							     (MEMBER CELL.NAME (CAR IMPLICATION]
       do (AND TRILLIUM.TRACE (NULL DONT.TRACE)
	       (SHOW.TRACE.FROM.CELL CELL.NAME (CADR IMPLICATION)))
	  (IMPLY.ITEM (CADR IMPLICATION)
		      OLD.VALUE NEW.VALUE DONT.TRACE])

(ACTIVATE.INHIBITORS
  [LAMBDA (FRAME CELL.NAME OLD.VALUE NEW.VALUE DONT.TRACE)   (* edited: " 1-NOV-82 11:31")
    (OR (EQ OLD.VALUE (QUOTE UNINITIALIZED))
	(for INHIBITOR in (GET.FIELDQ FRAME INHIBITORS FRAME)
	   when [OR (EQ CELL.NAME (CAR INHIBITOR))
		    (AND (LISTP (CAR INHIBITOR))
			 (MEMBER CELL.NAME (CAR INHIBITOR]
	   never (INHIBIT.ITEM (CADR INHIBITOR)
			       OLD.VALUE NEW.VALUE DONT.TRACE])

(ACTIVATE.INHIBITORS*
  [LAMBDA (FRAME CELL.NAME OLD.VALUE NEW.VALUE DONT.TRACE)   (* DAHJr "19-APR-83 21:46")
    (DECLARE (GLOBALVARS FRAME.ALL.INHIBITORS TRILLIUM.TRACE))
    (SET.FRAME.CONTEXT.IF.NECESSARY FRAME)
    (OR (EQ OLD.VALUE (QUOTE UNINITIALIZED))
	(for INHIBITOR in FRAME.ALL.INHIBITORS when [OR (EQ CELL.NAME (CAR INHIBITOR))
							(AND (LISTP (CAR INHIBITOR))
							     (MEMBER CELL.NAME (CAR INHIBITOR]
	   never (AND TRILLIUM.TRACE (NULL DONT.TRACE)
		      (SHOW.TRACE.FROM.CELL CELL.NAME (CADR INHIBITOR)))
		 (INHIBIT.ITEM (CADR INHIBITOR)
			       OLD.VALUE NEW.VALUE DONT.TRACE])

(ACTIVATE.INITIALIZATIONS
  [LAMBDA (FRAME)                                            (* edited: "22-DEC-82 12:22")
    (for INITIALIZATION in (GET.FIELDQ FRAME INITIALIZATION FRAME) do (INITIALIZE.ITEM INITIALIZATION 
										       FRAME])

(ACTIVATE.INITIALIZATIONS*
  [LAMBDA (FRAME)                                            (* DAHJr "16-FEB-83 10:01")

          (* (for SUPERFRAME.NAME bind SUPERFRAME in (GET.FIELDQ FRAME SUPERFRAMES FRAME) do (COND ((SETQ SUPERFRAME 
	  (FIND.FRAME CURRENT.INTERFACE SUPERFRAME.NAME)) (ACTIVATE.INITIALIZATIONS* SUPERFRAME)) (T 
	  (TRILLIUM.PRINTOUT "Frame " (GET.FIELDQ FRAME NAME) " has superframe " SUPERFRAME.NAME " which doesn't exist" 
	  " (initialization)")))) (ACTIVATE.INITIALIZATIONS FRAME))


    (DECLARE (GLOBALVARS FRAME.ALL.INITIALIZATIONS))
    (SET.FRAME.CONTEXT.IF.NECESSARY FRAME)
    (for INITIALIZATION in FRAME.ALL.INITIALIZATIONS do (INITIALIZE.ITEM INITIALIZATION FRAME])

(ACTIVATE.SENSORS
  [LAMBDA (FRAME TOUCH XCOORD YCOORD)                        (* HK "22-JUL-82 11:33")
    (for SENSOR in (GET.FIELDQ FRAME SENSORS FRAME) thereis (SENSE.ITEM SENSOR TOUCH XCOORD YCOORD 
									FRAME])

(ACTIVATE.SENSORS*
  [LAMBDA (FRAME TOUCH XCOORD YCOORD)                        (* DAHJr "16-FEB-83 10:04")

          (* (OR (ACTIVATE.SENSORS FRAME TOUCH XCOORD YCOORD) (for SUPERFRAME.NAME bind SUPERFRAME in 
	  (GET.FIELDQ FRAME SUPERFRAMES FRAME) thereis (COND ((SETQ SUPERFRAME (FIND.FRAME CURRENT.INTERFACE 
	  SUPERFRAME.NAME)) (ACTIVATE.SENSORS* SUPERFRAME TOUCH XCOORD YCOORD)) (T (TRILLIUM.PRINTOUT "Frame " 
	  (GET.FIELDQ FRAME NAME) " has superframe " SUPERFRAME.NAME " which doesn't exist" " (sensors)") NIL)))))


    (DECLARE (GLOBALVARS FRAME.ALL.SENSORS))
    (SET.FRAME.CONTEXT.IF.NECESSARY FRAME)
    (for SENSOR in FRAME.ALL.SENSORS thereis (SENSE.ITEM SENSOR TOUCH XCOORD YCOORD FRAME])

(ADD.THERM
  [LAMBDA (CELL DELTA MAX ROLL.TO)                           (* HK "22-JUL-82 09:33")
    (PROG (NEW.VALUE (CURRENT.VALUE (GET.CURRENT.VALUE CELL)))
          (SETQ NEW.VALUE (IPLUS CURRENT.VALUE DELTA))
          [COND
	    ((GREATERP NEW.VALUE MAX)
	      (SETQ NEW.VALUE (OR ROLL.TO MAX]
          (COND
	    ((NEQ CURRENT.VALUE NEW.VALUE)
	      (CHANGE.CURRENT.VALUE CELL NEW.VALUE])

(ADD.TO.FRAME.CONTEXT*
  [LAMBDA (FRAME)                                            (* DAHJr " 7-FEB-83 12:20")
                                                             (* SETS UP GLOBAL VARIABLES SO RUNNING OF THE FRAME GOES
							     FASTER)
                                                             (* BACK TO FRONT)
    (DECLARE (GLOBALVARS CURRENT.INTERFACE FRAME.ALL.ARTWORK FRAME.ALL.DISPLAYERS 
			 FRAME.ALL.IMPLICATIONS FRAME.ALL.INHIBITORS FRAME.ALL.INITIALIZATION 
			 FRAME.ALL.SENSORS))
    (SETQ FRAME.ALL.INITIALIZATION (APPEND (GET.FIELDQ FRAME INITIALIZATION)
					   FRAME.ALL.INITIALIZATION))
    (SETQ FRAME.ALL.ARTWORK (APPEND (GET.FIELDQ FRAME ARTWORK FRAME)
				    FRAME.ALL.ARTWORK))
    (SETQ FRAME.ALL.DISPLAYERS (APPEND (GET.FIELDQ FRAME DISPLAYERS)
				       FRAME.ALL.DISPLAYERS))
    (SETQ FRAME.ALL.IMPLICATIONS (APPEND (GET.FIELDQ FRAME IMPLICATIONS)
					 FRAME.ALL.IMPLICATIONS))
    [for SUPERFRAME.NAME bind SUPERFRAME in (GET.FIELDQ FRAME SUPERFRAMES FRAME)
       do (COND
	    ((SETQ SUPERFRAME (FIND.FRAME CURRENT.INTERFACE SUPERFRAME.NAME))
	      (ADD.TO.FRAME.CONTEXT* SUPERFRAME]             (* FRONT TO BACK)
    (SETQ FRAME.ALL.INHIBITORS (APPEND (GET.FIELDQ FRAME INHIBITORS)
				       FRAME.ALL.INHIBITORS))
    (SETQ FRAME.ALL.SENSORS (APPEND (GET.FIELDQ FRAME SENSORS)
				    FRAME.ALL.SENSORS])

(BITMAP.HEIGHT
  [LAMBDA (BITMAP.NAME)                                      (* KKM "29-DEC-82 12:30")
    (fetch (BITMAP BITMAPHEIGHT) of (FIND.BITMAP BITMAP.NAME])

(BITMAP.WIDTH
  [LAMBDA (BITMAP.NAME)                                      (* KKM "29-DEC-82 12:30")
    (fetch (BITMAP BITMAPWIDTH) of (FIND.BITMAP BITMAP.NAME])

(BUILD.STACK.OPERATION
  [LAMBDA (OPERATION FRAMENAME INITFLG)                      (* HaKo "27-Jul-84 11:34")
    (SELECTQ OPERATION
	     [PUSH (COND
		     ((EQ INITFLG (QUOTE DO.NOT.INITIALIZE))
		       (LIST (QUOTE FRAME.PUSH)
			     FRAMENAME T))
		     (T (LIST (QUOTE FRAME.PUSH)
			      FRAMENAME]
	     [POP (COND
		    ((EQ INITFLG (QUOTE INITIALIZE))
		      (LIST (QUOTE FRAME.POP)
			    FRAMENAME T))
		    (FRAMENAME (LIST (QUOTE FRAME.POP)
				     FRAMENAME))
		    (T (LIST (QUOTE FRAME.POP]
	     [NO.CHANGE (COND
			  ((EQ INITFLG (QUOTE INITIALIZE))
			    (LIST (QUOTE FRAME.GOTO)
				  FRAMENAME T))
			  (T (LIST (QUOTE FRAME.GOTO)
				   FRAMENAME]
	     (SHOULDNT (CONCAT "Unknown stack operation " OPERATION])

(CHANGE.CELL
  [NLAMBDA (FIELD.NAME NEW.VALUE.FORM DONT.TRACE)            (* edited: "22-DEC-82 13:30")
    (CHANGE.CURRENT.VALUE FIELD.NAME (TRILLIUM.EVAL NEW.VALUE.FORM "changing the value of a cell")
			  (EVAL DONT.TRACE])

(CHANGE.CURRENT.VALUE
  [LAMBDA (CELL.NAME NEW.VALUE DONT.TRACE)                   (* HaKo "16-Aug-84 16:21")
    (DECLARE (SPECVARS ITEM)
	     (GLOBALVARS CURRENT.FRAME TRILLIUM.TRACE))
    (PROG (FRAME OLD.VALUE)
          (SETQ FRAME CURRENT.FRAME)
          (SETQ OLD.VALUE (GET.CURRENT.VALUE CELL.NAME))
          (COND
	    ((AND TRILLIUM.TRACE (NOT DONT.TRACE))
	      (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "****************" T "Attempting to change " 
				 CELL.NAME " from " OLD.VALUE " to " NEW.VALUE)
	      (SHOW.TRACE.TO.CELL ITEM CELL.NAME)))
          (COND
	    [(EQUAL OLD.VALUE NEW.VALUE)
	      (COND
		((AND TRILLIUM.TRACE (NOT DONT.TRACE))
		  (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "Change " CELL.NAME " to " NEW.VALUE 
				     ": no change")
		  (SHOW.TRACE.NO.CHANGE CELL.NAME]
	    ((ACTIVATE.INHIBITORS* FRAME CELL.NAME OLD.VALUE NEW.VALUE DONT.TRACE)
	      (SET.CURRENT.VALUE CELL.NAME NEW.VALUE DONT.TRACE)
	      (ACTIVATE.DISPLAYERS* FRAME CELL.NAME DONT.TRACE)
	      (ACTIVATE.IMPLICATIONS* FRAME CELL.NAME OLD.VALUE NEW.VALUE DONT.TRACE))
	    (T (COND
		 ((AND TRILLIUM.TRACE (NOT DONT.TRACE))
		   (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "Change " CELL.NAME " to " NEW.VALUE 
				      ": inhibited")
		   (SHOW.TRACE.CHANGE CELL.NAME])

(DECREASE.CELL
  [LAMBDA (CELL DELTA MIN ROLL.TO RATE)                      (* edited: "19-MAY-82 12:24")
    (DECLARE (GLOBALVARS LASTMOUSEBUTTONS))
    (DIFF.THERM CELL DELTA MIN ROLL.TO)
    (COND
      (RATE (do (TRILLIUM.DISMISS RATE)
		(COND
		  ((MOUSESTATE UP)
		    (RETURN)))
		(DIFF.THERM CELL DELTA MIN ROLL.TO])

(DEFAULT.IMPLY.FN
  [LAMBDA (ITEM)                                             (* HaKo "27-Jul-84 11:54")
    (MISSING.ITYPE.FN ITEM (QUOTE IMPLY])

(DEFAULT.INHIBIT.FN
  [LAMBDA (ITEM)                                             (* HaKo "27-Jul-84 11:53")
    (MISSING.ITYPE.FN ITEM (QUOTE INHIBIT])

(DEFAULT.INITIALIZE.FN
  [LAMBDA (ITEM)                                             (* HaKo "27-Jul-84 11:55")
    (MISSING.ITYPE.FN ITEM (QUOTE INITIALIZE])

(DEFAULT.SENSE.FN
  [LAMBDA (ITEM TOUCH XCORD YCOORD FRAME)                    (* HaKo "27-Jul-84 11:38")
    (MISSING.ITYPE.FN ITEM (QUOTE SENSE])

(DIFF.THERM
  [LAMBDA (CELL DELTA MIN ROLL.TO)                           (* HK "22-JUL-82 09:49")
    (PROG (NEW.VALUE (CURRENT.VALUE (GET.CURRENT.VALUE CELL)))
          (SETQ NEW.VALUE (IDIFFERENCE CURRENT.VALUE DELTA))
          [COND
	    ((LESSP NEW.VALUE MIN)
	      (SETQ NEW.VALUE (OR ROLL.TO MIN]
          (COND
	    ((NEQ CURRENT.VALUE NEW.VALUE)
	      (CHANGE.CURRENT.VALUE CELL NEW.VALUE])

(DISABLE.TIMEOUT
  [NLAMBDA (CELL.NAME DONT.TRACE)                            (* edited: "22-MAR-83 10:05")
    (CHANGE.CURRENT.VALUE CELL.NAME (QUOTE OFF)
			  (EVAL DONT.TRACE])

(DO.FRAME.CHANGE
  [LAMBDA NIL                                                (* HaKo " 8-Aug-84 11:06")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS CURRENT.INTERFACE))
    (PROG ((SPECS CHANGE.FRAME.SPECIFICATIONS)
	   FRAME.NAME FRAME OPERATION)
          (SETQ CHANGE.FRAME.SPECIFICATIONS)
          (SETQ FRAME (LISTGET SPECS (QUOTE FRAME)))
          (SETQ OPERATION (LISTGET SPECS (QUOTE OPERATION)))
          [COND
	    ((NULL FRAME)
	      (SETQ FRAME.NAME (LISTGET SPECS (QUOTE FRAME.NAME)))
	      (COND
		(FRAME.NAME (SETQ FRAME (FIND.FRAME CURRENT.INTERFACE FRAME.NAME))
			    (COND
			      ((NULL FRAME)
				(TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "Frame " FRAME.NAME 
						   " not found in interface "
						   (GET.FIELDQ CURRENT.INTERFACE NAME INTERFACE))
				(RETURN]
          (if (SETQ FRAME (SELECTQ OPERATION
				   (PUSH (FRAME.DO.PUSH FRAME))
				   (POP (FRAME.DO.POP FRAME))
				   (NO.CHANGE (FRAME.DO.GOTO FRAME))
				   (TROUBLE.WITH.TRILLIUM ON TRILLIUM.WARNINGS 
							  "Unrecognized OPERATION"
							  OPERATION)))
	      then (BEGIN.EVENT (QUOTE $FrameChangeEvent$))
		   (START.FRAME FRAME (LISTGET SPECS (QUOTE INITIALIZE)))
		   (END.EVENT])

(DO.POP.CELL
  [LAMBDA (FIELD.NAME)                                       (* edited: " 3-JAN-83 08:42")
    (PROG (NEW.VALUE OLD.VALUE)
          (SETQ OLD.VALUE (GET.CURRENT.VALUE FIELD.NAME))
          (SETQ NEW.VALUE (CDR OLD.VALUE))
          (CHANGE.CURRENT.VALUE FIELD.NAME NEW.VALUE)
          (RETURN (CAR OLD.VALUE])

(DO.PUSH.CELL
  [LAMBDA (FIELD.NAME NEW.VALUE)                             (* edited: " 3-JAN-83 08:35")
    (PROG (STACK)
          (SETQ STACK (GET.CURRENT.VALUE FIELD.NAME))
          (CHANGE.CURRENT.VALUE FIELD.NAME (CONS NEW.VALUE STACK])

(FIND.CELL
  [LAMBDA (FIELD.NAME)                                       (* HK "22-JUL-82 09:50")
    (DECLARE (GLOBALVARS CURRENT.MACHINE.STATE))
    (OR (LISTGET CURRENT.MACHINE.STATE FIELD.NAME)
	(LISTPUT CURRENT.MACHINE.STATE FIELD.NAME (LIST (QUOTE VALUE)
							(QUOTE UNINITIALIZED])

(FLOAT.DIGIT.CELL
  [NLAMBDA (TEXT.CELL.NAME PLACES.CELL.NAME)                 (* KKM "29-DEC-82 14:44")
    (PROG NIL
          (COND
	    ((EQ (GET.CURRENT.VALUE PLACES.CELL.NAME)
		 -1)
	      (CHANGE.CURRENT.VALUE TEXT.CELL.NAME (CONCAT (GET.CURRENT.VALUE TEXT.CELL.NAME)
							   "."))
	      (CHANGE.CURRENT.VALUE PLACES.CELL.NAME 0])

(FRAME.DO.GOTO
  [LAMBDA (FRAME)                                            (* HaKo "15-Aug-84 15:40")
    (if FRAME
	then [TRILLIUM.STACK (CONS (GET.FIELDQ FRAME NAME)
				   (CDR (TRILLIUM.STACK]
      else (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "Can't go to unspecified frame!"))
    FRAME])

(FRAME.DO.POP
  [LAMBDA (FRAME)                                            (* HaKo "15-Aug-84 15:36")
    (DECLARE (GLOBALVARS CURRENT.INTERFACE))
    (PROG [(STACK (CDR (TRILLIUM.STACK]
          (COND
	    ((NULL STACK)
	      (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "At the bottom of the stack; can't pop further")
	      )
	    [(NULL FRAME)
	      (SETQ FRAME (FIND.FRAME CURRENT.INTERFACE (CAR STACK]
	    ((NULL (SETQ STACK (FMEMB (GET.FIELDQ FRAME NAME)
				      STACK)))
	      (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "The frame " (GET.FIELDQ FRAME NAME)
				 " is not on the stack; can't return to it")))
          (if STACK
	      then (TRILLIUM.STACK STACK)
		   (RETURN FRAME])

(FRAME.DO.PUSH
  [LAMBDA (FRAME)                                            (* HaKo "15-Aug-84 15:40")
    (if FRAME
	then (TRILLIUM.STACK (CONS (GET.FIELDQ FRAME NAME FRAME)
				   (TRILLIUM.STACK)))
	     FRAME
      else (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "Can't push to unspecified frame!")
	   NIL])

(FRAME.GOTO
  [NLAMBDA (FRAME.NAME INITIALIZE)                           (* edited: "25-MAY-82 19:12")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS))
    (SETQ CHANGE.FRAME.SPECIFICATIONS (LIST (QUOTE OPERATION)
					    (QUOTE NO.CHANGE)
					    (QUOTE FRAME.NAME)
					    FRAME.NAME
					    (QUOTE INITIALIZE)
					    INITIALIZE])

(FRAME.POP
  [NLAMBDA (FRAME.NAME INITIALIZE)                           (* edited: " 6-MAY-82 11:34")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS))
    (SETQ CHANGE.FRAME.SPECIFICATIONS (LIST (QUOTE OPERATION)
					    (QUOTE POP)
					    (QUOTE FRAME.NAME)
					    FRAME.NAME
					    (QUOTE INITIALIZE)
					    INITIALIZE])

(FRAME.POP.EVAL
  [LAMBDA (FRAME.NAME INITIALIZE)                            (* (KKM) "11-FEB-83 15:33")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS))
    (SETQ CHANGE.FRAME.SPECIFICATIONS (LIST (QUOTE OPERATION)
					    (QUOTE POP)
					    (QUOTE FRAME.NAME)
					    FRAME.NAME
					    (QUOTE INITIALIZE)
					    INITIALIZE])

(FRAME.PUSH
  [NLAMBDA (FRAME.NAME DONOTINITIALIZE)                      (* edited: " 6-MAY-82 11:36")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS))
    (SETQ CHANGE.FRAME.SPECIFICATIONS (LIST (QUOTE OPERATION)
					    (QUOTE PUSH)
					    (QUOTE FRAME.NAME)
					    FRAME.NAME
					    (QUOTE INITIALIZE)
					    (NOT DONOTINITIALIZE])

(FRAME.PUSH.EVAL
  [LAMBDA (FRAME.NAME DONOTINITIALIZE)                       (* (KKM) "11-FEB-83 15:26")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS))
    (SETQ CHANGE.FRAME.SPECIFICATIONS (LIST (QUOTE OPERATION)
					    (QUOTE PUSH)
					    (QUOTE FRAME.NAME)
					    FRAME.NAME
					    (QUOTE INITIALIZE)
					    (NOT DONOTINITIALIZE])

(IMPLY.ITEM
  [LAMBDA (ITEM OLD.VALUE NEW.VALUE DONT.TRACE)              (* HaKo " 8-Aug-84 10:07")
    (PROG (RESULT)
          (if (NLSETQ (SETQ RESULT (APPLY* (OR (GETPROP (ITEM.TYPE ITEM)
							(QUOTE IMPLY))
					       (FUNCTION DEFAULT.IMPLY.FN))
					   ITEM OLD.VALUE NEW.VALUE DONT.TRACE)))
	      then (RETURN RESULT)
	    else (REPORT.LISP.ERROR "carrying out implication on item" ITEM
				    (LIST "IMPLY.ITEM item" OLD.VALUE NEW.VALUE DONT.TRACE])

(INCREASE.CELL
  [LAMBDA (CELL DELTA MAX ROLL.TO RATE)                      (* edited: "19-MAY-82 12:23")
    (DECLARE (GLOBALVARS LASTMOUSEBUTTONS))
    (ADD.THERM CELL DELTA MAX ROLL.TO)
    (COND
      (RATE (do (TRILLIUM.DISMISS RATE)
		(COND
		  ((MOUSESTATE UP)
		    (RETURN)))
		(ADD.THERM CELL DELTA MAX ROLL.TO])

(INHIBIT.ITEM
  [LAMBDA (ITEM OLD.VALUE NEW.VALUE DONT.TRACE)              (* HaKo " 8-Aug-84 10:06")
    (PROG (RESULT)
          (if (NLSETQ (SETQ RESULT (APPLY* (OR (GETPROP (ITEM.TYPE ITEM)
							(QUOTE INHIBIT))
					       (FUNCTION DEFAULT.INHIBIT.FN))
					   ITEM OLD.VALUE NEW.VALUE DONT.TRACE)))
	      then (RETURN RESULT)
	    else (REPORT.LISP.ERROR "checking inhibition on item" ITEM (LIST "INHIBIT.ITEM item" 
									     OLD.VALUE NEW.VALUE 
									     DONT.TRACE])

(INITIALIZE.ITEM
  [LAMBDA (ITEM FRAME)                                       (* HaKo " 8-Aug-84 10:09")
    (if (NULL (NLSETQ (APPLY* (OR (GETPROP (ITEM.TYPE ITEM)
					   (QUOTE INITIALIZE))
				  (FUNCTION DEFAULT.INITIALIZE.FN))
			      ITEM FRAME)))
	then (REPORT.LISP.ERROR "initializing an initialization" ITEM])

(LENGTH.OF.CELL
  [NLAMBDA (FIELD.NAME)                                      (* edited: " 3-AUG-81 14:12")
    (LENGTH (GET.CURRENT.VALUE FIELD.NAME])

(MACHINE.STATE.CREATE
  [LAMBDA NIL
    (LIST (QUOTE \TYPE)
	  (QUOTE MACHINE.STATE])

(MARK.FRAME.CONTEXT.OBSOLETE
  [LAMBDA NIL                                                (* DAHJr "31-Mar-84 17:37")
    (DECLARE (GLOBALVARS FRAME.ALL.OBSOLETE))
    (SETQ FRAME.ALL.OBSOLETE T])

(NEW.STACK
  [LAMBDA (STACK ELEMENT VALUE)                              (* edited: " 5-JUN-82 12:48")
    (COND
      ((EQ ELEMENT 1)
	(RPLACA STACK VALUE))
      (T (NEW.STACK (CDR STACK)
		    (SUB1 ELEMENT)
		    VALUE)))
    STACK])

(NEXT.DECIMAL.DIGIT.CELL
  [NLAMBDA (NUMBER.CELL.NAME NEW.DIGIT.FORM TEXT.CELL.NAME PLACES.CELL.NAME DONT.TRACE)
                                                             (* HaKo "25-Jul-84 17:04")
    (PROG (NEW.DIGIT OLD.VALUE OLD.TEXT OLD.PLACES)
          (SETQ NEW.DIGIT (EVAL NEW.DIGIT.FORM))
          (SETQ OLD.VALUE (GET.CURRENT.VALUE NUMBER.CELL.NAME))
          (SETQ OLD.TEXT (GET.CURRENT.VALUE TEXT.CELL.NAME))
          (SETQ OLD.PLACES (GET.CURRENT.VALUE PLACES.CELL.NAME))
          (COND
	    ((NOT (NUMBERP NEW.DIGIT))
	      (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "CHANGE.CELL on cell " NUMBER.CELL.NAME 
				 "; new digit is not a number: "
				 NEW.DIGIT))
	    ((NOT (NUMBERP OLD.VALUE))
	      (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "CHANGE.CELL on cell " NUMBER.CELL.NAME 
				 "; current value is not a number; "
				 OLD.VALUE))
	    (T (COND
		 ((EQ OLD.PLACES -1)
		   (CHANGE.CURRENT.VALUE NUMBER.CELL.NAME (IPLUS (ITIMES OLD.VALUE 10)
								 NEW.DIGIT)
					 DONT.TRACE)
		   (CHANGE.CURRENT.VALUE TEXT.CELL.NAME [COND
					   ((EQ OLD.VALUE 0)
					     (MKSTRING NEW.DIGIT))
					   (T (CONCAT OLD.TEXT (MKSTRING NEW.DIGIT]
					 DONT.TRACE))
		 (T (CHANGE.CURRENT.VALUE TEXT.CELL.NAME (CONCAT OLD.TEXT (MKSTRING NEW.DIGIT))
					  DONT.TRACE)
		    (CHANGE.CURRENT.VALUE PLACES.CELL.NAME (SETQ OLD.PLACES (ADD1 OLD.PLACES))
					  DONT.TRACE)
		    (CHANGE.CURRENT.VALUE NUMBER.CELL.NAME (FPLUS OLD.VALUE (FQUOTIENT NEW.DIGIT
										       (EXPT 10 
										       OLD.PLACES)))
					  DONT.TRACE])

(NEXT.DIGIT.CELL
  [NLAMBDA (FIELD.NAME NEW.DIGIT.FORM DONT.TRACE)            (* HaKo "25-Jul-84 17:04")
    (PROG (NEW.DIGIT OLD.VALUE)
          (SETQ NEW.DIGIT (EVAL NEW.DIGIT.FORM))
          (SETQ OLD.VALUE (GET.CURRENT.VALUE FIELD.NAME))
          (COND
	    ((NOT (NUMBERP NEW.DIGIT))
	      (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "CHANGE.CELL on cell " FIELD.NAME 
				 "; new digit is not a number: "
				 NEW.DIGIT))
	    ((NOT (NUMBERP OLD.VALUE))
	      (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "CHANGE.CELL on cell " FIELD.NAME 
				 "; current value is not a number; "
				 OLD.VALUE))
	    (T (CHANGE.CURRENT.VALUE FIELD.NAME (IPLUS (ITIMES OLD.VALUE 10)
						       NEW.DIGIT)
				     DONT.TRACE])

(NTH.OF.CELL
  [NLAMBDA (FIELD.NAME VALUE.FORM)                           (* edited: " 3-AUG-81 14:12")
    (PROG ((VALUE (EVAL VALUE.FORM))
	   OLD.VALUE)
          (SETQ OLD.VALUE (GET.CURRENT.VALUE FIELD.NAME))
          (RETURN (CAR (NTH OLD.VALUE VALUE])

(POP.CELL
  [NLAMBDA (FIELD.NAME)                                      (* edited: " 3-JAN-83 08:44")
    (DO.POP.CELL FIELD.NAME])

(POP.FROM.CELL
  [NLAMBDA (FIELD.NAME)                                      (* edited: "28-MAY-82 11:36")
    (PROG (OLD.VALUE)
          (SETQ OLD.VALUE (GET.CURRENT.VALUE FIELD.NAME))
          (CHANGE.CURRENT.VALUE FIELD.NAME (CDR OLD.VALUE))
          (RETURN (CAR OLD.VALUE])

(PUSH.CELL
  [NLAMBDA (FIELD.NAME VALUE.FORM)                           (* edited: " 3-JAN-83 08:36")
    (PROG (NEW.VALUE)
          (SETQ NEW.VALUE (TRILLIUM.EVAL VALUE.FORM "pushing a value onto a cell"))
          (DO.PUSH.CELL FIELD.NAME NEW.VALUE)
          (RETURN NEW.VALUE])

(PUSH.TO.CELL
  [NLAMBDA (FIELD.NAME VALUE.FORM)                           (* edited: "28-MAY-82 11:33")
    (CHANGE.CURRENT.VALUE FIELD.NAME (CONS (EVAL VALUE.FORM)
					   (GET.CURRENT.VALUE FIELD.NAME])

(RESTORE.INTERFACE.CONTEXT
  [LAMBDA (WINDOW)                                           (* PH "24-Aug-84 09:55")
    (DECLARE (GLOBALVARS CURRENT.BITMAP.FRAMES CURRENT.DSP CURRENT.FRAME CURRENT.FRAME.NAMES 
			 CURRENT.INTERFACE CURRENT.INTERFACE.WINDOW CURRENT.MACHINE.STATE 
			 IN.LIVING.COLOR FRAME.NAME.MENU))
    (SETQ CURRENT.INTERFACE.WINDOW WINDOW)
    (SETQ CURRENT.DSP (WINDOWPROP WINDOW (QUOTE DSP)))
    (SETQ CURRENT.MACHINE.STATE (WINDOWPROP WINDOW (QUOTE MACHINE.STATE)))
    (SETQ CURRENT.INTERFACE (WINDOWPROP WINDOW (QUOTE INTERFACE)))
    (SETQ CURRENT.FRAME (WINDOWPROP WINDOW (QUOTE CURRENT.FRAME)))
    (SETQ CURRENT.FRAME.NAMES (for FRAME in (GET.FIELDQ CURRENT.INTERFACE FRAMES)
				 collect (GET.FIELDQ FRAME NAME)))
    (SETQ CURRENT.BITMAP.FRAMES)
    (SETQ FRAME.NAME.MENU)
    (COND
      (IN.LIVING.COLOR (INSTALL.COLOR.MAP CURRENT.INTERFACE)))
    (SET.FRAME.CONTEXT CURRENT.FRAME])

(RESTORE.INTERFACE.CONTEXT.IF.NECESSARY
  [LAMBDA (WINDOW)                                           (* edited: "13-Jun-84 16:47")
    (DECLARE (GLOBALVARS CURRENT.INTERFACE.WINDOW))
    (COND
      ((NEQ WINDOW CURRENT.INTERFACE.WINDOW)
	(RESTORE.INTERFACE.CONTEXT WINDOW])

(SENSE.FRAME
  [LAMBDA (WINDOW)                                           (* kkm "19-Nov-84 15:55")
                                                             (* HaKo " 8-Aug-84 15:13")
                                                             (* DAHJr " 5-May-84 15:25")
    (DECLARE (GLOBALVARS CHANGE.FRAME.SPECIFICATIONS CURRENT.DSP CURRENT.FRAME LASTMOUSEBUTTONS 
			 LASTMOUSEX LASTMOUSEY TRILLIUM.MODE))
    (SYNC.CLOCK T)
    (do (AND CHANGE.FRAME.SPECIFICATIONS (DO.FRAME.CHANGE))
	(GETMOUSESTATE)
	(COND
	  ((NOT (INSIDEP (WINDOWPROP WINDOW (QUOTE REGION))
			 LASTMOUSEX LASTMOUSEY))
	    (RETURN (QUOTE NOTHING)))
	  ((AND TRILLIUM.MODE (LASTMOUSESTATE (ONLY MIDDLE)))
	    (RETURN (QUOTE MIDDLE)))
	  ((AND TRILLIUM.MODE (LASTMOUSESTATE (ONLY RIGHT)))
	    (RETURN (QUOTE RIGHT)))
	  (T (SYNC.CLOCK)
	     (ACTIVATE.SENSORS* CURRENT.FRAME (LASTMOUSESTATE (ONLY LEFT))
				(LASTMOUSEX CURRENT.DSP)
				(LASTMOUSEY CURRENT.DSP])

(SENSE.ITEM
  [LAMBDA (ITEM TOUCH XCOORD YCOORD FRAME)                   (* HaKo " 8-Aug-84 10:09")
    (PROG (RESULT)
          (if (NLSETQ (SETQ RESULT (APPLY* (OR (GETPROP (ITEM.TYPE ITEM)
							(QUOTE SENSE))
					       (FUNCTION DEFAULT.SENSE.FN))
					   ITEM TOUCH XCOORD YCOORD FRAME)))
	      then (RETURN RESULT)
	    else (REPORT.LISP.ERROR "sensing an item" ITEM (LIST "SENSE.ITEM item" TOUCH XCOORD 
								 YCOORD "frame"])

(SET.CELL
  [NLAMBDA (FIELD.NAME NEW.VALUE.FORM DONT.TRACE)            (* edited: "22-DEC-82 13:30")
    (PROG (NEW.VALUE)
          [COND
	    [(LITATOM NEW.VALUE.FORM)
	      (SETQ NEW.VALUE (EVALV NEW.VALUE.FORM))
	      (COND
		((EQ NEW.VALUE (QUOTE NOBIND))
		  (SETQ NEW.VALUE NEW.VALUE.FORM]
	    (T (SETQ NEW.VALUE (TRILLIUM.EVAL NEW.VALUE.FORM "setting the value of a cell"]
          (SET.CURRENT.VALUE FIELD.NAME NEW.VALUE (EVAL DONT.TRACE])

(SET.CURRENT.VALUE
  [LAMBDA (CELL.NAME NEW.VALUE DONT.TRACE)                   (* HaKo "16-Aug-84 16:21")
    (DECLARE (SPECVARS ITEM)
	     (GLOBALVARS TRILLIUM.TRACE))
    (AND TRILLIUM.TRACE (NOT DONT.TRACE)
	 (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "Change " CELL.NAME " to " NEW.VALUE ": change made")
	 (SHOW.TRACE.TO.CELL ITEM CELL.NAME))
    (LISTPUT (FIND.CELL CELL.NAME)
	     (QUOTE VALUE)
	     NEW.VALUE])

(SET.FRAME.CONTEXT
  [LAMBDA (FRAME)                                            (* DAHJr "16-FEB-83 11:34")
                                                             (* SETS UP GLOBAL VARIABLES SO RUNNING OF THE FRAME GOES
							     FASTER)
    (DECLARE (GLOBALVARS CURRENT.INTERFACE FRAME.ALL.ARTWORK FRAME.ALL.DISPLAYERS 
			 FRAME.ALL.IMPLICATIONS FRAME.ALL.INHIBITORS FRAME.ALL.INITIALIZATION 
			 FRAME.ALL.OBSOLETE FRAME.ALL.SENSORS))
    (SETQ FRAME.ALL.INITIALIZATION (APPEND (GET.FIELDQ FRAME INITIALIZATION)))
    (SETQ FRAME.ALL.ARTWORK (APPEND (GET.FIELDQ FRAME ARTWORK FRAME)))
    (SETQ FRAME.ALL.SENSORS NIL)
    (SETQ FRAME.ALL.INHIBITORS NIL)
    (SETQ FRAME.ALL.DISPLAYERS (APPEND (GET.FIELDQ FRAME DISPLAYERS)))
    (SETQ FRAME.ALL.IMPLICATIONS (APPEND (GET.FIELDQ FRAME IMPLICATIONS)))
    [for SUPERFRAME.NAME bind SUPERFRAME in (GET.FIELDQ FRAME SUPERFRAMES FRAME)
       do (COND
	    ((SETQ SUPERFRAME (FIND.FRAME CURRENT.INTERFACE SUPERFRAME.NAME))
	      (ADD.TO.FRAME.CONTEXT* SUPERFRAME]
    (SETQ FRAME.ALL.INHIBITORS (NCONC (REVERSE (GET.FIELDQ FRAME INHIBITORS))
				      FRAME.ALL.INHIBITORS))
    (SETQ FRAME.ALL.SENSORS (NCONC (REVERSE (GET.FIELDQ FRAME SENSORS))
				   FRAME.ALL.SENSORS))
    (SETQ FRAME.ALL.OBSOLETE])

(SET.FRAME.CONTEXT.IF.NECESSARY
  [LAMBDA (FRAME)
    (DECLARE (GLOBALVARS FRAME.ALL.OBSOLETE))
    (COND
      (FRAME.ALL.OBSOLETE (SET.FRAME.CONTEXT FRAME])

(SET.NTH.OF.CELL
  [NLAMBDA (FIELD.NAME ELEMENT.FORM VALUE.FORM)              (* edited: "22-DEC-82 13:31")
    (PROG (VALUE ELEMENT STACK)
          (SETQ VALUE (TRILLIUM.EVAL VALUE.FORM "setting the n-th value of a list in a cell"))
          (SETQ ELEMENT (TRILLIUM.EVAL ELEMENT.FORM "setting the n-th value of a list in a cell"))
          (SETQ STACK (GET.CURRENT.VALUE FIELD.NAME))
          (CHANGE.CURRENT.VALUE FIELD.NAME (NEW.STACK STACK ELEMENT VALUE))
          (RETURN VALUE])

(SETUP.TRACING
  [LAMBDA (TURN.ON)                                          (* HaKo "25-Jul-84 17:05")
    (DECLARE (GLOBALVARS TRILLIUM.TRACE TRILLIUM.TRACE.WINDOW))
    (SETQ TRILLIUM.TRACE TURN.ON)
    (COND
      [TURN.ON (COND
		 (TRILLIUM.TRACE.WINDOW (OPENW TRILLIUM.TRACE.WINDOW))
		 (T (TRILLIUM.PRINTOUT ON PROMPTWINDOW "Indicate a region for the TRACE window")
		    (SETQ TRILLIUM.TRACE.WINDOW (CREATEW NIL "Trillium trace window"]
      (T (AND TRILLIUM.TRACE.WINDOW (CLOSEW TRILLIUM.TRACE.WINDOW])

(SHOW.TRACE.CHANGE
  [LAMBDA (CELL.NAME)                                        (* HaKo "16-Aug-84 16:21")
    (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "SHOW.TRACE.CHANGE")
    (SHOW.TRACE.PAUSE])

(SHOW.TRACE.FROM.CELL
  [LAMBDA (CELL.NAME ITEM)                                   (* DAHJr "22-APR-83 19:32")
    (DECLARE (GLOBALVARS CURRENT.INTERFACE.WINDOW))
    (COND
      (CELL.NAME (PROG (MACHINE.WINDOW BBOX CELL.REGION)
		       (SETQ MACHINE.WINDOW (TRILLIUM.TRACE.MACHINE.WINDOW CURRENT.INTERFACE.WINDOW))
		       (OPENW MACHINE.WINDOW)
		       (SETQ CELL.REGION (TRILLIUM.TRACE.FIND.REGION MACHINE.WINDOW CELL.NAME))
		       (SETQ BBOX (BOUNDING.BOX ITEM))
		       (FLIP.REGION.IN.WINDOW CELL.REGION MACHINE.WINDOW)
		       (FLIP.REGION.IN.WINDOW BBOX CURRENT.INTERFACE.WINDOW)
		       (SHOW.TRACE.STREAK (LIST (SCREEN.COORDS (REGION/CENTER CELL.REGION)
							       MACHINE.WINDOW)
						(SCREEN.COORDS (REGION/CENTER BBOX)
							       CURRENT.INTERFACE.WINDOW)
						(SCREEN.COORDS (REGION/CENTER BBOX)
							       CURRENT.INTERFACE.WINDOW)))
		       (SHOW.TRACE.PAUSE)
		       (FLIP.REGION.IN.WINDOW CELL.REGION MACHINE.WINDOW)
		       (FLIP.REGION.IN.WINDOW BBOX CURRENT.INTERFACE.WINDOW])

(SHOW.TRACE.NO.CHANGE
  [LAMBDA (CELL.NAME)                                        (* HaKo "16-Aug-84 16:22")
    (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "SHOW.TRACE.NO.CHANGE ")
    (SHOW.TRACE.PAUSE])

(SHOW.TRACE.PAUSE
  [LAMBDA NIL                                                (* DAHJr "22-APR-83 18:53")
    (PROG (PAUSED)
          (while (KEYDOWNP (QUOTE LSHIFT)) do (SETQ PAUSED T))
          (COND
	    (PAUSED (TRILLIUM.PAUSE 1000])

(SHOW.TRACE.STREAK
  [LAMBDA (KNOTS)                                            (* edited: " 6-May-84 15:37")
    (DECLARE (GLOBALVARS TRILLIUM.TRACE TRILLIUM.TRACE.LINE.BITMAP TRILLIUM.TRACE.STREAK.BITMAP))
    (SELECTQ TRILLIUM.TRACE
	     (PAIRS (DISMISS 500))
	     (PAIRS+LINE (TRAJECTORY.FOLLOW KNOTS NIL 400 NIL TRILLIUM.TRACE.LINE.BITMAP))
	     (PAIRS+TRAJECTORY (TRAJECTORY.FOLLOW KNOTS NIL 400 NIL TRILLIUM.TRACE.STREAK.BITMAP))
	     (TROUBLE.WITH.TRILLIUM "Unrecognized trace type" TRILLIUM.TRACE])

(SHOW.TRACE.TO.CELL
  [LAMBDA (ITEM CELL.NAME)                                   (* HaKo " 5-AUG-83 13:25")
    (DECLARE (GLOBALVARS CURRENT.INTERFACE.WINDOW))
    (OR (NULL CELL.NAME)
	(PROG (MACHINE.WINDOW BBOX CELL.REGION)
	      (SETQ MACHINE.WINDOW (TRILLIUM.TRACE.MACHINE.WINDOW CURRENT.INTERFACE.WINDOW))
	      (OPENW MACHINE.WINDOW)
	      (SETQ CELL.REGION (TRILLIUM.TRACE.FIND.REGION MACHINE.WINDOW CELL.NAME))
	      (SETQ BBOX (BOUNDING.BOX ITEM))
	      (FLIP.REGION.IN.WINDOW BBOX CURRENT.INTERFACE.WINDOW)
	      (FLIP.REGION.IN.WINDOW CELL.REGION MACHINE.WINDOW)
	      (SHOW.TRACE.STREAK (LIST (SCREEN.COORDS (REGION/CENTER BBOX)
						      CURRENT.INTERFACE.WINDOW)
				       (SCREEN.COORDS (REGION/CENTER CELL.REGION)
						      MACHINE.WINDOW)
				       (SCREEN.COORDS (REGION/CENTER CELL.REGION)
						      MACHINE.WINDOW)))
	      (FLIP.REGION.IN.WINDOW CELL.REGION MACHINE.WINDOW)
	      (INSPECTW.REDISPLAY MACHINE.WINDOW)
	      (FLIP.REGION.IN.WINDOW CELL.REGION MACHINE.WINDOW)
	      (SHOW.TRACE.PAUSE)
	      (FLIP.REGION.IN.WINDOW BBOX CURRENT.INTERFACE.WINDOW)
	      (FLIP.REGION.IN.WINDOW CELL.REGION MACHINE.WINDOW])

(START.FRAME
  [LAMBDA (FRAME INITIALIZE?)                                (* HaKo "16-Aug-84 16:23")
    (DECLARE (GLOBALVARS CURRENT.FRAME CURRENT.INTERFACE.WINDOW REPORT.FRAMES))
    (FORGET.EDIT.WINDOWS)
    (WINDOWPROP CURRENT.INTERFACE.WINDOW (QUOTE CURRENT.FRAME)
		FRAME)
    (SETQ CURRENT.FRAME FRAME)
    (ANALYZE.FRAME.IF.NECESSARY* FRAME)
    (MARK.FRAME.CONTEXT.OBSOLETE FRAME)
    (DISPLAY.FRAME FRAME INITIALIZE?)
    (INTERFACE.WINDOW.CHANGE.TITLE)
    (AND REPORT.FRAMES (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "Running frame " (GET.FIELDQ 
										    CURRENT.FRAME 
											 NAME FRAME])

(START.TIMEOUT
  [NLAMBDA (CELL.NAME DONT.TRACE)                            (* edited: "22-MAR-83 10:04")
    (CHANGE.CURRENT.VALUE CELL.NAME (CELL.VALUE CLOCK)
			  (EVAL DONT.TRACE])

(SYNC.CLOCK
  [LAMBDA (REENTRY)                                          (* HaKo " 8-Aug-84 10:28")
    (if REENTRY
	then (SET.CELL \LOST.TIME [IPLUS (CELL.VALUE \LOST.TIME)
					 (CLOCKDIFFERENCE (IPLUS (CELL.VALUE CLOCK)
								 (CELL.VALUE \CLOCK.ZERO)
								 (CELL.VALUE \LOST.TIME]
		       T)
      else (CHANGE.CELL CLOCK (IDIFFERENCE (CLOCKDIFFERENCE (CELL.VALUE \CLOCK.ZERO))
					   (CELL.VALUE \LOST.TIME))
			T])

(TRILLIUM.DISMISS
  [LAMBDA (TIME)                                             (* edited: "14-MAY-82 09:13")
    (PROG (START)
          (SETQ START (CLOCK 0))
          (until (IGREATERP (CLOCKDIFFERENCE START)
			    TIME)
	     do NIL])

(TRILLIUM.PAUSE
  [LAMBDA (MILLISECONDS)                                     (* HaKo " 8-Aug-84 10:50")
                                                             (* DAHJr "22-APR-83 18:53")
    (bind (BASE ←(CLOCK 0)) while (IGREATERP MILLISECONDS (CLOCKDIFFERENCE BASE)) do (NILL])

(TRILLIUM.STACK
  [LAMBDA ({NEWSTACK} {INTERFACE.WINDOW})                    (* HaKo "15-Aug-84 16:35")
    (DECLARE (GLOBALVARS CURRENT.INTERFACE.WINDOW))
    (if {NEWSTACK}
	then (WINDOWPROP (OR {INTERFACE.WINDOW} CURRENT.INTERFACE.WINDOW)
			 (QUOTE TRILLIUM.STACK)
			 {NEWSTACK})
      else (WINDOWPROP (OR {INTERFACE.WINDOW} CURRENT.INTERFACE.WINDOW)
		       (QUOTE TRILLIUM.STACK])

(TRILLIUM.TRACE.FIND.REGION
  [LAMBDA (WINDOW PROPERTY)                                  (* DAHJr "22-APR-83 17:00")
    (PROG (SELECTABLEITEMS SELECTABLEITEM)
          (SETQ SELECTABLEITEMS (WINDOWPROP WINDOW (QUOTE SELECTABLEITEMS)))
          [SETQ SELECTABLEITEM (for ITEM in SELECTABLEITEMS thereis (AND (EQ (CADDDR ITEM)
									     (QUOTE PROPERTY))
									 (EQ (CADDR ITEM)
									     PROPERTY]
          (RETURN (CAR SELECTABLEITEM])

(TRILLIUM.TRACE.MACHINE.WINDOW
  [LAMBDA (INTERFACE.WINDOW)                                 (* HaKo " 5-AUG-83 13:24")
    (DECLARE (GLOBALVARS CURRENT.MACHINE.STATE))
    (PROG (MACHINE.WINDOW OLD.LENGTH)
          (AND (SETQ MACHINE.WINDOW (WINDOWPROP INTERFACE.WINDOW (QUOTE MACHINE.WINDOW)))
	       (SETQ OLD.LENGTH (WINDOWPROP MACHINE.WINDOW (QUOTE MACHINE.STATE.LENGTH)))
	       (EQLENGTH CURRENT.MACHINE.STATE OLD.LENGTH)
	       (RETURN MACHINE.WINDOW))
          (SETQ MACHINE.WINDOW (PROPLIST.WINDOW.CREATE CURRENT.MACHINE.STATE))
          (WINDOWPROP MACHINE.WINDOW (QUOTE TRILLIUM.WINDOW.TYPE)
		      (QUOTE MACHINE.EDITOR))
          (WINDOWPROP MACHINE.WINDOW (QUOTE MACHINE.STATE.LENGTH)
		      (LENGTH CURRENT.MACHINE.STATE))
          (WINDOWPROP INTERFACE.WINDOW (QUOTE MACHINE.WINDOW)
		      MACHINE.WINDOW)
          (ADD.DEPENDENT.WINDOW INTERFACE.WINDOW MACHINE.WINDOW)
          (RETURN MACHINE.WINDOW])

(TRILLIUM.TRACE.SETUP
  [LAMBDA (STYLE)                                            (* edited: " 6-May-84 15:09")
    (DECLARE (GLOBALVARS TRILLIUM.TRACE))
    (SETQ TRILLIUM.TRACE (COND
	((EQ STYLE (QUOTE OFF))
	  NIL)
	(T STYLE])
)

(RPAQQ REPORT.FRAMES T)

(RPAQQ TRILLIUM.BEING.CAREFUL T)

(RPAQQ TRILLIUM.KNOWS.LISP T)

(RPAQQ TRILLIUM.TRACE NIL)

(RPAQQ TRILLIUM.TRACE.WINDOW NIL)

(RPAQQ CHANGE.FRAME.SPECIFICATIONS NIL)
(READVARS TRILLIUM.TRACE.STREAK.BITMAP TRILLIUM.TRACE.LINE.BITMAP)
({(READBITMAP)(3 3
"D@@@"
"N@@@"
"D@@@")}  {(READBITMAP)(1 1
"H@@@")})
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML START.TIMEOUT SET.NTH.OF.CELL SET.CELL PUSH.TO.CELL PUSH.CELL POP.FROM.CELL POP.CELL 
			      NTH.OF.CELL NEXT.DIGIT.CELL NEXT.DECIMAL.DIGIT.CELL LENGTH.OF.CELL 
			      FRAME.PUSH FRAME.POP FRAME.GOTO FLOAT.DIGIT.CELL DISABLE.TIMEOUT 
			      CHANGE.CELL ACTION.SPEAK ACTION.PRINT)

(ADDTOVAR LAMA )
)
(PUTPROPS TRI-RUN COPYRIGHT ("Xerox Corporation" 1984))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (2394 40487 (ACTION.DONOTHING 2404 . 2445) (ACTION.PRINT 2447 . 2612) (ACTION.SPEAK 2614
 . 2734) (ACTIVATE.DISPLAYERS 2736 . 3963) (ACTIVATE.DISPLAYERS* 3965 . 5199) (ACTIVATE.IMPLICATIONS 
5201 . 5611) (ACTIVATE.IMPLICATIONS* 5613 . 6232) (ACTIVATE.INHIBITORS 6234 . 6674) (
ACTIVATE.INHIBITORS* 6676 . 7323) (ACTIVATE.INITIALIZATIONS 7325 . 7593) (ACTIVATE.INITIALIZATIONS* 
7595 . 8341) (ACTIVATE.SENSORS 8343 . 8587) (ACTIVATE.SENSORS* 8589 . 9346) (ADD.THERM 9348 . 9759) (
ADD.TO.FRAME.CONTEXT* 9761 . 11168) (BITMAP.HEIGHT 11170 . 11350) (BITMAP.WIDTH 11352 . 11530) (
BUILD.STACK.OPERATION 11532 . 12280) (CHANGE.CELL 12282 . 12520) (CHANGE.CURRENT.VALUE 12522 . 13830) 
(DECREASE.CELL 13832 . 14184) (DEFAULT.IMPLY.FN 14186 . 14341) (DEFAULT.INHIBIT.FN 14343 . 14502) (
DEFAULT.INITIALIZE.FN 14504 . 14669) (DEFAULT.SENSE.FN 14671 . 14826) (DIFF.THERM 14828 . 15243) (
DISABLE.TIMEOUT 15245 . 15436) (DO.FRAME.CHANGE 15438 . 16667) (DO.POP.CELL 16669 . 17006) (
DO.PUSH.CELL 17008 . 17263) (FIND.CELL 17265 . 17566) (FLOAT.DIGIT.CELL 17568 . 17925) (FRAME.DO.GOTO 
17927 . 18250) (FRAME.DO.POP 18252 . 18971) (FRAME.DO.PUSH 18973 . 19310) (FRAME.GOTO 19312 . 19668) (
FRAME.POP 19670 . 20019) (FRAME.POP.EVAL 20021 . 20373) (FRAME.PUSH 20375 . 20736) (FRAME.PUSH.EVAL 
20738 . 21102) (IMPLY.ITEM 21104 . 21587) (INCREASE.CELL 21589 . 21939) (INHIBIT.ITEM 21941 . 22449) (
INITIALIZE.ITEM 22451 . 22787) (LENGTH.OF.CELL 22789 . 22947) (MACHINE.STATE.CREATE 22949 . 23038) (
MARK.FRAME.CONTEXT.OBSOLETE 23040 . 23248) (NEW.STACK 23250 . 23498) (NEXT.DECIMAL.DIGIT.CELL 23500 . 
25071) (NEXT.DIGIT.CELL 25073 . 25800) (NTH.OF.CELL 25802 . 26069) (POP.CELL 26071 . 26213) (
POP.FROM.CELL 26215 . 26507) (PUSH.CELL 26509 . 26804) (PUSH.TO.CELL 26806 . 27023) (
RESTORE.INTERFACE.CONTEXT 27025 . 27967) (RESTORE.INTERFACE.CONTEXT.IF.NECESSARY 27969 . 28259) (
SENSE.FRAME 28261 . 29245) (SENSE.ITEM 29247 . 29707) (SET.CELL 29709 . 30173) (SET.CURRENT.VALUE 
30175 . 30611) (SET.FRAME.CONTEXT 30613 . 31914) (SET.FRAME.CONTEXT.IF.NECESSARY 31916 . 32086) (
SET.NTH.OF.CELL 32088 . 32593) (SETUP.TRACING 32595 . 33118) (SHOW.TRACE.CHANGE 33120 . 33324) (
SHOW.TRACE.FROM.CELL 33326 . 34374) (SHOW.TRACE.NO.CHANGE 34376 . 34587) (SHOW.TRACE.PAUSE 34589 . 
34849) (SHOW.TRACE.STREAK 34851 . 35374) (SHOW.TRACE.TO.CELL 35376 . 36560) (START.FRAME 36562 . 37185
) (START.TIMEOUT 37187 . 37383) (SYNC.CLOCK 37385 . 37840) (TRILLIUM.DISMISS 37842 . 38097) (
TRILLIUM.PAUSE 38099 . 38408) (TRILLIUM.STACK 38410 . 38823) (TRILLIUM.TRACE.FIND.REGION 38825 . 39295
) (TRILLIUM.TRACE.MACHINE.WINDOW 39297 . 40241) (TRILLIUM.TRACE.SETUP 40243 . 40485)))))
STOP