raw
adalisp_genesis         1 (define length (lambda (L)
adalisp_genesis 2 (if (eq? L '())
adalisp_genesis 3 0
adalisp_genesis 4 (+ 1 (length (cdr L))))))
adalisp_genesis 5
adalisp_genesis 6 (define map (lambda (f L)
adalisp_genesis 7 (if (eq? L '())
adalisp_genesis 8 '()
adalisp_genesis 9 (cons (f (car L)) (map f (cdr L))))))
adalisp_genesis 10
adalisp_genesis 11 (define fibs (lambda (n)
adalisp_genesis 12 (if (= n 0)
adalisp_genesis 13 0
adalisp_genesis 14 (if (= n 1)
adalisp_genesis 15 1
adalisp_genesis 16 (+ (fibs (- n 1)) (fibs (- n 2)))))))
adalisp_genesis 17
adalisp_genesis 18 (define fact (lambda (n)
adalisp_genesis 19 (if (= n 0)
adalisp_genesis 20 1
adalisp_genesis 21 (* n (fact (- n 1))))))
adalisp_genesis 22
adalisp_genesis 23 (define equal? (lambda (x y)
adalisp_genesis 24 (if (pair? x)
adalisp_genesis 25 (and (pair? y)
adalisp_genesis 26 (equal? (car x) (car y))
adalisp_genesis 27 (equal? (cdr x) (cdr y)))
adalisp_genesis 28 (eqv? x y))))
adalisp_genesis 29
adalisp_genesis 30 (define 1+ (lambda (x) (+ x 1)))
adalisp_genesis 31 (define 1- (lambda (x) (- x 1)))
adalisp_genesis 32
adalisp_genesis 33 (define succ 1+)
adalisp_genesis 34 (define pred 1-)
adalisp_genesis 35
adalisp_genesis 36 (if (= (length '(a b c d e f g)) 7) 'passed 'failed)
adalisp_genesis 37 (if (equal? (map (lambda (x) (* x x)) '(1 2 3 4 5))
adalisp_genesis 38 '(1 4 9 16 25))
adalisp_genesis 39 'passed 'failed)
adalisp_genesis 40 (if (= (fibs 10) 55) 'passed 'failed)
adalisp_genesis 41 (if (= (fact 10) 3628800) 'passed 'failed)