(FILECREATED "17-Mar-86 18:16:43" {ERIS}<TAMARIN>WORK>SIMULATE>TEST2FNS.;2 2917 changes to: (VARS TEST2FNSCOMS) previous date: "28-Feb-86 18:59:12" {ERIS}<TAMARIN>WORK>SIMULATE>TEST2FNS.;1) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT TEST2FNSCOMS) (RPAQQ TEST2FNSCOMS ((* second TAMULATOR test) (FNS TEST2) (* original -- tail recursion eliminated) (FNS TEST2A) (* as TEST2 but does call itself) (FNS TESTA) (FNS TEST2B) (* returns sum of those of 1st 6 args that non-NIL) (FNS FIB) (* crude Fibonacci series) (FNS TEST TESTFVAR))) (* second TAMULATOR test) (DEFINEQ (TEST2 [LAMBDA (X) (* jmh "27-Feb-86 08:57") (* * oops -- tail recursion elimination) (COND ((EQ X 0) X) (T (TEST2 (SUB1 X]) ) (* original -- tail recursion eliminated) (DEFINEQ (TEST2A [LAMBDA (X) (* rtk "28-Feb-86 17:10") (COND ((NEQ X 6) (TESTA X)) (T X]) ) (* as TEST2 but does call itself) (DEFINEQ (TESTA [LAMBDA (X) (* rtk "28-Feb-86 17:08") (TEST2A (IPLUS X 1]) ) (DEFINEQ (TEST2B [LAMBDA (A1 A2 A3 A4 A5 A6) (* jmh "27-Feb-86 12:24") (IPLUS (if A1 else 0) (if A2 else 0) (if A3 else 0) (if A4 else 0) (if A5 else 0) (if A6 else 0]) ) (* returns sum of those of 1st 6 args that non-NIL) (DEFINEQ (FIB [LAMBDA (X) (* jmh "27-Feb-86 12:49") (if (OR (EQ X 0) (EQ X 1)) then 1 else (IPLUS (FIB (IDIFFERENCE X 1)) (FIB (IDIFFERENCE X 2]) ) (* crude Fibonacci series) (DEFINEQ (TEST [LAMBDA (Y) (* edited: "17-Mar-86 15:07") (PROG ((X 5)) (SETQ X (CONS 6 (CONS 5 NIL))) (TESTFVAR (if (GREATERP Y (CAR X)) then (CADR X) else (CAR X]) (TESTFVAR [LAMBDA (Y) (* edited: "13-Mar-86 15:32") (SETQ X (IPLUS Y X]) ) (PUTPROPS TEST2FNS COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (726 1069 (TEST2 736 . 1067)) (1120 1290 (TEST2A 1130 . 1288)) (1333 1475 (TESTA 1343 . 1473)) (1476 1963 (TEST2B 1486 . 1961)) (2024 2395 (FIB 2034 . 2393)) (2431 2838 (TEST 2441 . 2701) ( TESTFVAR 2703 . 2836))))) STOP