(define (remove an-i a-loi) (cond [(empty? a-loi) empty] [else (cond [(eq? (first a-loi) an-i) (remove an-i (rest a-loi))] [else (cons (first a-loi) (remove an-i (rest a-loi)))])])) (remove 0 (list 0 1 2 0 3)) = (remove 0 (list 1 2 0 3)) = (cons 1 (remove 0 (list 2 0 3))) = (cons 1 (cons 2 (remove 0 (list 0 3)))) = (cons 1 (cons 2 (remove 0 (list 3)))) = (cons 1 (cons 2 (cons 3 (remove 0 empty)))) = (cons 1 (cons 2 (cons 3 empty))) = (list 1 2 3) #| If you put this code into the definition window of DrScheme and click on EXECUTE, you will see (cons 1 (cons 2 (cons 3 empty))) six times in the evalution window. (The last line is an abbreviation). |#