Evaluation of sum_list

(define (sum_list list) 
           (cond 
             ((null? list) 0) 
             ((list? (car list)) 
               (+ (sum_list (car list)) (sum_list (cdr list)))) 
             (T (+ (car list) (sum_list (cdr list)))) 
            ) 
          ) 

       The function invocation 

       (sum_list '(((1) (2 3)) (4 5))) returns 15.  Check --


Last updated 2000/10/29
© J.A.N. Lee, 2000.