Artifact b772c3060dece4051974caf302cfdb04becaab9b29bfd0ae2016bbca2e519570:
- File
psl-1983/3-1/tests/main1.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: 1487) [annotate] [blame] [check-ins using] [more...]
% Simple 1 file test % This is program MAIN1.RED IN "XXX-HEADER.RED"$ On SYSLISP; Procedure FirstCall; <<Init(); PutC Char F; PutC Char !a; PutC Char !c; PutC Char !=; PutInt Ifact 10; Terpri(); PutC Char T; PutC Char !e; PutC Char !s; PutC Char !t; PutC Char F; PutC Char !a; PutC Char !c; PutC Char !t; Terpri(); TestFact(); Terpri(); PutC Char T; PutC Char !e; PutC Char !s; PutC Char !t; PutC Char T; PutC Char !a; PutC Char !k; Terpri(); TestTak(); Quit;>>; procedure terpri(); PutC Char EOL; Procedure TestFact(); << PutInt Timc(); Terpri(); ArithmeticTest 10000; PutInt Timc(); Terpri(); >>; Procedure ArithmeticTest (N); begin scalar I; I:= 0; loop: if Igreaterp(I,N) then return NIL; Fact 9; I := iadd1 I; goto loop end; procedure TestTak(); <<PutInt Timc(); Terpri(); PutInt TopLevelTak (18,12,6); Terpri(); PutInt Timc(); Terpri();>>; syslsp procedure Fact (N); If ilessp(N,2) then 1 else LongTimes(N,Fact isub1 N); syslsp procedure Ifact u; Begin scalar m; m:=1; L1: if u eq 1 then return M; M:=LongTimes(U,M); u:=u-1; PutInt(u); Terpri(); PutInt(M); Terpri(); goto L1; end; in "pt:tak.sl"$ off syslisp; procedure UndefinedFunctionAux; <<Putc Char U; Putc Char !n; Putc Char !d; Putc Char !e; Putc Char !f; Putc Char Blank; Putint UndefnCode!*; Terpri(); Quit;>>; end;