DIRECTORY PFS USING [Error, PathFromRope, StreamOpen], TJaM USING [AtomFromRope, CommandProc, Error, ExecuteStream, PopRope, PushRope, RegisterPrimitive, ROPE, STREAM]; TJaMIOImpl: CEDAR PROGRAM IMPORTS PFS, TJaM ~ BEGIN OPEN TJaM; badName: ATOM ~ AtomFromRope[".badname"]; pfsError: ATOM ~ AtomFromRope[".pfserror"]; ApplyRun: CommandProc = { fileName: ROPE ~ PopRope[frame]; errorAtom: ATOM ¬ NIL; stream: STREAM ¬ NIL; stream ¬ PFS.StreamOpen[PFS.PathFromRope[fileName] ! PFS.Error => { SELECT error.group FROM user => errorAtom ¬ badName; ENDCASE => { PushRope[frame, error.explanation]; errorAtom ¬ pfsError }; CONTINUE; }; ]; IF stream#NIL THEN ExecuteStream[frame, stream] ELSE ERROR Error[errorAtom]; }; RegisterPrimitive[".run", ApplyRun]; END. Ζ TJaMIOImpl.mesa Copyright Σ 1985, 1986, 1991, 1992 by Xerox Corporation. All rights reserved. Maureen Stone, February 14, 1985 6:42:18 pm PST Michael Plass, December 20, 1989 2:26:20 pm PST Willie-s, February 14, 1991 8:41 pm PST Doug Wyatt, November 27, 1992 2:04 pm PST RegisterPrimitive[".stream", ApplyStream]; RegisterPrimitive[".readitem", ApplyReadItem]; RegisterPrimitive[".writeitem", ApplyWriteItem]; RegisterPrimitive[".writebytes", ApplyWriteBytes]; RegisterPrimitive[".killstream", ApplyKillStream]; RegisterPrimitive[".print", ApplyPrint]; RegisterPrimitive[".loadbcd", ApplyLoadBCD]; RegisterPrimitive[".iochar", ApplyIOChar]; RegisterPrimitive[".iobool", ApplyIOBool]; RegisterPrimitive[".ioint", ApplyIOInt]; RegisterPrimitive[".ioreal", ApplyIOReal]; RegisterPrimitive[".ioline", ApplyIOLine]; RegisterPrimitive[".iotoken", ApplyIOToken]; RegisterPrimitive[".iocedartoken", ApplyIOCedarToken]; RegisterPrimitive[".ioclose", ApplyIOClose]; Κ –(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ ΟeœC™NK™/K™/K™'K™)—K˜šΟk ˜ Kšžœžœ#˜,KšœžœYžœžœ˜q—K˜KšΠbl œžœž˜Kšžœžœ˜Kšœžœžœ˜K˜Kšœ žœ˜)Kšœ žœ˜+K˜šΟnœœ˜Kšœ žœ˜ Kšœ žœžœ˜Kšœžœžœ˜šœ žœ žœ˜4šžœ ˜šžœ ž˜Kšœ˜KšžœA˜H—Kšžœ˜ K˜—Kšœ˜—šžœž˜ Kšžœ˜!Kšžœžœ˜—K˜K˜—K˜Kšœ$˜$K™Kšœ*™*Kšœ.™.Kšœ0™0Kšœ2™2Kšœ2™2Kšœ(™(Kšœ,™,Kšœ*™*Kšœ*™*Kšœ(™(Kšœ*™*Kšœ*™*Kšœ,™,Kšœ6™6Kšœ,™,K˜Kšžœ˜K˜—…—ϊΚ