DIRECTORY Commander USING [CommandProc, Handle, Register], CommanderOps USING [ArgN, NumArgs], IO, LocalCirio USING [Connection, DoUnderMonitorLock, GetConnection, GetDummyStack, ReleaseConnection], Rope USING [Length, ROPE, Substr], StackCirio USING [InterpretTextLine, Stack]; CirioEval: CEDAR MONITOR IMPORTS Commander, CommanderOps, IO, LocalCirio, Rope, StackCirio ~ { ch: Commander.Handle ฌ NIL; DontCallMe: PUBLIC PROCEDURE [key: CARD32] = { IF ch # NIL THEN IO.PutRope[ch.out, "If you get this message, then scream and holler, because it should never appear.\n"]; }; CirioEvalCmd: Commander.CommandProc ~ { connection: LocalCirio.Connection; numArgs:CARD ฌ CommanderOps.NumArgs[cmd]; stack: StackCirio.Stack ฌ NIL; reslt, line: Rope.ROPE ฌ NIL; interpret: PROC = {reslt ฌ StackCirio.InterpretTextLine[stack, line, cmd.out]}; ch ฌ cmd; IF numArgs > 1 THEN { connection ฌ LocalCirio.GetConnection[["CirioEval", "DontCallMe"], cmd.out]; IF connection # NIL THEN { stack ฌ LocalCirio.GetDummyStack[connection, cmd.out]; line ฌ Rope.Substr[cmd.commandLine, CommanderOps.ArgN[cmd, 0].Length]; LocalCirio.DoUnderMonitorLock[connection, interpret]; IO.PutF1[cmd.out, "%g\n", IO.rope[reslt]]; LocalCirio.ReleaseConnection[connection, cmd.out]; } } }; Commander.Register["_", CirioEvalCmd, "Evaluate an expression in the local world."]; Commander.Register["ฌ", CirioEvalCmd, "Evaluate an expression in the local world."]; }. า CirioEval.mesa Copyright ำ 1991, 1993 by Xerox Corporation. All rights reserved. Philip James, July 2, 1991 3:58 pm PDT Laurie Horton, February 8, 1993 12:02 pm PST Willie-s, March 2, 1993 4:20 pm PST สฉ•NewlineDelimiter –"cedarcode" style™™Jšœ ฯeœ7™BJ™&J™,J™#J™—codešฯk œ˜ Kšœ žœ!˜0Kšœ žœ˜#Kšžœ˜Kšœ žœS˜cKšœžœ žœ ˜"Kšœ žœ˜,K˜—š ฯn œžœžœžœžœ"˜^K˜K˜Kšœžœ˜K˜šŸ œžœž œžœ˜.Kšžœžœžœj˜~K˜—šŸ œ˜'Kšœ"˜"Kšœžœ˜)Kšœžœ˜Kšœžœžœ˜K˜Kšœ žœ@˜OK˜ šžœ žœ˜K˜Lšžœžœžœ˜K˜6K˜FK˜5Kšžœžœ˜*Kšœ2˜2K˜—K˜—K˜—K˜K˜TK˜TK˜——…—˜