Artifact 9d7eef5695cdb95a31ede384f54a1b5f503e2e2850763b2377f999c7bfd2a67a:
- File
psl-1983/3-1/util/pcheck.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: 1124) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/util/pcheck.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: 1124) [annotate] [blame] [check-ins using]
% <PSL.UTIL>PCHECK.RED.3, 11-Oct-82 18:14:36, Edit by BENSON % Changed CATCH to *CATCH % A little program to check parens in a LISP file Fluid '(LastSexpr!*); procedure Pcheck F; begin scalar Chan,OldChan; LastSexpr!*:=NIL; Chan:=Open(F,'Input); OldChan:=RDS(Chan); !*Catch(NIL,Pcheck1()); Rds(OldChan); Close chan; % Printf("last Full S-expression%r%n",LastSexpr!*); end; %/ can we enable Line counter somehow? procedure Pcheck1(); Begin Scalar x; L: x:=Read(); if x eq !$EOF!$ then return NIL; LastSexpr!*:=x; PrintSome x; Goto L; End; procedure printsome x; <<Prinsomelevel(x,2,3);terpri()>>; procedure prinsomelevel(x,l1,l2); If not pairp x then <<prin1 x; prin2 " ">> else if l1 <=0 then prin2 " ... " else if l2 <=0 then prin2 " ... " else <<prin2 "("; prinsomelevel(car x,l1-1,l2); if null cdr x then prin2 ")" else if ListP cdr x then <<prinsomelevel(cdr x,l1,l2-1); prin2 ")">> else <<prin2 " . "; prinsomelevel(cdr x,l1,l2-1); prin2 ")">> >>; procedure ListP x; null x or (Pairp x and ListP cdr x); end;