Artifact 4df1d986c0f40cc71c048bf0bbfc32c5c4d7cbdd64b7b6d98d27c7c1e3e59e22:
- File
psl-1983/3-1/tests/mini-printers.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2070) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/tests/mini-printers.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2070) [annotate] [blame] [check-ins using]
% MINI-PRINT.RED - More comprehensive Mini I/O % A mini Print routine % uses PutC and PutInt On syslisp; syslsp procedure Prin1 x; if IDP x then Prin1ID x else if IntP x then Prin1Int x else if StringP x then Prin1String x else if PairP x then Prin1Pair x else PrtItm x; syslsp procedure Prin2 x; if IDP x then Prin2ID x else if IntP x then Prin1Int x else if StringP x then Prin2String x else if PairP x then Prin2Pair x else PrtItm x; syslsp procedure Print x; <<Prin1 X; Terpri(); x>>; syslsp procedure Prin2t x; <<Prin2 X; Terpri(); x>>; % Support syslsp procedure Pblank; PutC Char '! ; syslsp procedure Prin1Int x; <<if x=0 then PutC Char 0 else if x<0 then <<PutC Char '!-; Prin1Int (-x)>> else Prin1IntX x; x>>; Procedure Prin1IntX x; If x=0 then NIL else <<Prin1IntX LongDiv(x,10); PutC (LongRemainder(x,10)+Char 0)>>; syslsp procedure Prin1ID x; <<Prin2String Symnam IdInf x; PBlank(); x>>; syslsp procedure Prin2Id x; prin1Id x; syslsp procedure Prin1String x; <<PutC Char '!"; Prin2String x; PutC Char '!"; Pblank(); x>>; syslsp procedure Prin2String x; Begin scalar s; s:=StrInf x; For i:=0:StrLen(s) do PutC StrByt(S,I); return x End; syslsp procedure Prin1Pair x; <<PutC Char '!(; Prin1 Car x; x:=Cdr X; While Pairp X do <<Pblank(); Prin1 Car X; X:=Cdr x>>; If Not NULL X then <<Prin2String " . "; Prin1 x>>; PutC Char '!) ; Pblank(); x>>; syslsp procedure Prin2Pair x; <<PutC Char '!(; Prin2 Car x; x:=Cdr X; While Pairp X do <<Pblank(); Prin2 Car X; X:=Cdr x>>; If Not NULL X then <<Prin2String " . "; Prin2 x>>; PutC Char '!) ; Pblank(); x>>; syslsp procedure terpri(); Putc Char EOL; syslsp procedure PrtItm x; <<Prin2String " <"; Prin1Int Tag x; PutC Char '!:; Prin1Int Inf x; Prin2String "> "; x>>; % Some stubs for later stuff Procedure ChannelPrin2(chn,x); Prin2 x; Off syslisp; End;