(FILECREATED "30-Dec-85 15:01:33" {ERIS}<LISPUSERS>KOTO>RPC-EXAMPLE.;3 7139 changes to: (FNS ArgTestB) previous date: " 6-Dec-85 16:23:35" {ERIS}<LISPUSERS>KOTO>RPC-EXAMPLE.;2) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT RPC-EXAMPLECOMS) (RPAQQ RPC-EXAMPLECOMS ((VARS SimpleSignals SimpleSpec SimpleTypes SimpleKey) (FNS ArgTestA ArgTestB Complex Simple) (RECORDS ArgTestAResult ComplexResult ArgTestBResult FakeResult NooneArgs Rec1 Rec2 Rec3 Rec4 Rec6 Rec5))) (RPAQQ SimpleSignals ((SimpleFailed (ARGS (Enumeration badNum badString))) (NooneFailed (ARGS NooneArgs) (RETURNS BOOLEAN)) (Fake (RETURNS FakeResult)))) (RPAQQ SimpleSpec ((Simple (first FIXP) (second STRING) (RETURNS BOOLEAN)) (Complex (r1 BOOLEAN) (r2 BOOLEAN) (r3 Rec3) (r4 Rec4) (r5 (STREAM {NODIRCORE})) (r5a (REF Rec3)) (r5b (REF Rec3)) (r6 Rec3) (r7 STRING) (r8 Rec1) (r9 Rec2) (r10 (REF Rec5)) (l1 (LIST SSMALLP)) (l2 (LIST MList)) (RETURNS ComplexResult)) (ArgTestA (a SSMALLP) (b FIXP) (c BOOLEAN) (d STRING) (e ATOM) (f (STREAM {DSK}ARGFILE)) (RETURNS ArgTestAResult)) (ArgTestB (a STRING) (b SSMALLP) (c ATOM) (d (STREAM {NODIRCORE})) (e FIXP) (f BOOLEAN) (RETURNS ArgTestBResult)))) (RPAQQ SimpleTypes [(MyEnum (ENUMERATION yen twa henery penery flat)) (Rec1 (RECORD (f1 BOOLEAN) (f2 BOOLEAN) (f3 MyEnum) (f4 STRING) (f5 ATOM))) (Rec2 (RECORD (g1 BOOLEAN) (g2 BOOLEAN) (g3 Rec1) (g4 ATOM))) (Rec3 (RECORD (h1 Boolean) (h2 MyEnum))) (Rec4 (RECORD (j1 Boolean) (j2 Rec3) (j3 FIXP))) (Rec6 (RECORD (m1 BOOLEAN) (m2 STRING))) [Rec5 (SEQRECORD (k1 BOOLEAN) (k1a STRING) (size SSMALLP) (k2 (SEQUENCE Rec6] (MList (LIST Rec1)) (ComplexResult (RESULT (a BOOLEAN) (b STRING) (c BOOLEAN))) (ArgTestAResult (RESULT (a1 SSMALLP) (a2 FIXP) (a3 BOOLEAN) (a4 STRING) (a5 ATOM))) (ArgTestBResult (RESULT (b1 STRING) (b2 SSMALLP) (b3 ATOM) (b4 FIXP) (b5 BOOLEAN))) (NooneArgs (SIGARGS (n1 STRING) (n2 SSMALLP))) (FakeResult (RESULT (fr1 ATOM) (fr2 Rec1]) (RPAQQ SimpleKey "Simple~361#0#12471136105") (DEFINEQ (ArgTestA [LAMBDA (a b c d e f) (* lmm " 6-Dec-85 16:22") (PROG1 (create ArgTestAResult a1 ← (PLUS a 1) a2 ← (MINUS b) a3 ← (if [AND (EQ (READC f) (QUOTE a)) (PROGN (SETFILEPTR f 601) (EQ (READC f) (QUOTE b] then (NOT c) else c) a4 ← d a5 ← e) (CLOSEF f]) (ArgTestB [LAMBDA (a b c d e f) (* ht: "30-Dec-85 15:00") (PROG1 (create ArgTestBResult b2 ←(PLUS b 1) b4 ←(-e) b5 ←(if (AND (READC d)= 'a (PROGN (SETFILEPTR d 601) (READC d)= 'b)) then (NOT f) else f) b1 ← a b3 ← c) (CLOSEF d]) (Complex [LAMBDA (r1 r2 r3 r4 r5 r5a r5b r6 r7 r8 r9 r10 l1 l2) (* lmm " 6-Dec-85 16:23") (LET (ca cb cc) (if [NOT (AND r1 (EQUAL r3 (QUOTE (T penery))) (fetch j1 of r4) (EQUAL (fetch j2 of r4) (QUOTE (NIL henery))) (EQUAL r5a (QUOTE (T twa))) (NOT r5b) (EQUAL r6 (QUOTE (T penery))) (STREQUAL r7 "second string") (EQUAL r8 (QUOTE (T NIL flat "third string" atom))) (EQUAL r9 (QUOTE (T NIL (T NIL yen "fourth string" nother) foo] then (SETQ cb "Failure 1") elseif (NEQ (LENGTH l1) 8) then (SETQ cb "failure 4") elseif (NOT (for i from 1 to 4 as e in l1 always (EQ i e))) then (SETQ cb "failure 2") elseif (NOT (for i from -1 by -1 as e in (CDDDDR l1) always (EQ i e))) then (SETQ cb "Failure 3") elseif (NEQ (LENGTH l2) 3) then (SETQ cb "Failure 11") elseif (CAR l2) then (SETQ cb "Failure 5") elseif (NEQ (LENGTH (CADR l2)) 2) then (SETQ cb "Failure 8") elseif [NOT (EQUAL (CAADR l2) (QUOTE (T NIL yen "s1" a1] then (SETQ cb "Failure 6") elseif [NOT (EQUAL (CADR (CADR l2)) (QUOTE (NIL T twa "s2" a2] then (SETQ cb "Failure 7") elseif (NEQ (LENGTH (CADDR l2)) 1) then (SETQ cb "Failure 10") elseif [NOT (EQUAL (CAR (CADDR l2)) (QUOTE (T T henery "s3" a3] then (SETQ cb "Failure 9") else (SETQ ca (SETQ cc T)) (SETQ cb "Success")) (if [NOT (EQUAL r10 (QUOTE (T "s6" 2 (NIL "s4") (T "s5"] then (SETQ cb "Failure 1a")) (if r2 then (if (NOT (EQP (PLUS r4:j3 240) (GETEOFPTR r5))) then (SETQ cb "Failure 12")) elseif [NOT (AND (EQP r4:j3 123456) (EQ (GETEOFPTR r5) 12) (LET [(ss (OPENSTRINGSTREAM "first string" (QUOTE INPUT] (PROG1 (for i from 1 to 12 always (EQ (\BIN ss) (\BIN r5))) (CLOSEF ss] then (SETQ cb "Failure 13")) (create ComplexResult a ← ca b ← cb c ← cc]) (Simple [LAMBDA (first second) (* lmm " 6-Dec-85 16:21") (if (LESSP first 0) then (Signal (QUOTE SimpleFailed) (QUOTE badNum))) (if (IEQP (NCHARS second) (TIMES first 2)) then (Signal (QUOTE SimpleFailed) (QUOTE badString))) (IEQP (NCHARS second) first]) ) [DECLARE: EVAL@COMPILE (RECORD ArgTestAResult (a1 a2 a3 a4 a5)) (RECORD ComplexResult (a b c)) (RECORD ArgTestBResult (b1 b2 b3 b4 b5)) (RECORD FakeResult (fr1 fr2)) (RECORD NooneArgs (n1 n2)) (RECORD Rec1 (f1 f2 f3 f4 f5)) (RECORD Rec2 (g1 g2 g3 g4)) (RECORD Rec3 (h1 h2)) (RECORD Rec4 (j1 j2 j3)) (RECORD Rec6 (m1 m2)) (RECORD Rec5 (k1 k1a size . k2)) ] (PUTPROPS RPC-EXAMPLE COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (2704 6645 (ArgTestA 2714 . 3180) (ArgTestB 3182 . 3601) (Complex 3603 . 6242) (Simple 6244 . 6643))))) STOP