Artifact a9261531a43fffc9ce01da1f18ad69ad915a544249a784de9fe1fe56ca1de4f9:
- File
psl-1983/3-1/util/printer-fix.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: 1688) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/util/printer-fix.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: 1688) [annotate] [blame] [check-ins using]
% Some patches to I/O modules Fluid '(DigitStrBase); DigitStrBase:='"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; on syslisp; smacro procedure DigitStr(); strinf LispVar DigitstrBase; syslsp procedure SysPowerOf2P Num; case Num of 1: 0; 2: 1; 4: 2; 8: 3; 16: 4; 32: 5; default: NIL end; syslsp procedure ChannelWriteSysInteger(Channel, Number, Radix); begin scalar Exponent,N1; return if (Exponent := SysPowerOf2P Radix) then ChannelWriteBitString(Channel, Number, Radix - 1, Exponent) else if Number < 0 then << ChannelWriteChar(Channel, char '!-); WriteNumber1(Channel,-(Number/Radix),Radix); % To catch largest NEG ChannelWriteChar(Channel, strbyt(DigitStr(), - MOD(Number, Radix))) >> else if Number = 0 then ChannelWriteChar(Channel, char !0) else WriteNumber1(Channel, Number, Radix); end; syslsp procedure WriteNumber1(Channel, Number, Radix); if Number = 0 then Channel else << WriteNumber1(Channel, Number / Radix, Radix); ChannelWriteChar(Channel, strbyt(Digitstr(), MOD(Number, Radix))) >>; syslsp procedure ChannelWriteBitString(Channel, Number, DigitMask, Exponent); if Number = 0 then ChannelWriteChar(Channel,char !0) else ChannelWriteBitStrAux(Channel, Number, DigitMask, Exponent); syslsp procedure ChannelWriteBitStrAux(Channel, Number, DigitMask, Exponent); if Number = 0 then Channel % Channel means nothing here else % just trying to fool the compiler << ChannelWriteBitStrAux(Channel, LSH(Number, -Exponent), DigitMask, Exponent); ChannelWriteChar(Channel, StrByt(DigitStr(), LAND(Number, DigitMask))) >>;