LISP - Problem 4 Solution for Problem 4:

(define replacelast (a l)
    (cond
         ((atom l) nil)
         ((null (cdr l)) (list a))
         (t (cons (car l) (replacelast a (cdr l))))
    )
)

Your final score is being recorded.


Last updated 2001/06/25
© J.A.N. Lee, 2001.