PrintStack.Mesa
Last Edited by: Spreitzer, March 14, 1984 4:29:42 pm PST
DIRECTORY AMBridge, AMTypes, IO, PrincOps, PrincOpsUtils, PrintTV, ViewerIO;
PrintStack: CEDAR PROGRAM
IMPORTS AMBridge, AMTypes, IO, PrincOpsUtils, PrintTV, ViewerIO =
BEGIN
TV: TYPE = AMTypes.TV;
log: IO.STREAM ← ViewerIO.CreateViewerStreams["PrintStack"].out;
Print: PROC =
BEGIN
me, local: TV;
TRUSTED {me ← AMBridge.TVForFrame[PrincOpsUtils.MyLocalFrame[]]};
FOR local ← me, AMTypes.DynamicParent[local] WHILE local # NIL DO
what: TV;
what ← AMTypes.Procedure[local !AMTypes.Error => {what ← NIL; CONTINUE}];
IF what = NIL THEN what ← AMTypes.Signal[local !AMTypes.Error => {what ← NIL; CONTINUE}];
PrintTV.Print[what, log];
log.PutRope["\n"];
ENDLOOP;
END;
Signal: SIGNAL = CODE;
SigTest: PROC =
BEGIN
Sub: PROC = {SIGNAL Signal[]};
Sub[!Signal => {Print[]; CONTINUE}];
END;
SigTest2: PROC =
BEGIN
Signal2: SIGNAL = CODE;
Sub: PROC = {SIGNAL Signal2[]};
Sub[!Signal2 => {Print[]; CONTINUE}];
END;
END.