Hi list,

No doubt something of a newbie question this...

This simple procedure behaves as expected, i.e., it provides the sum of
a list of numbers:

 (define add
   (lambda (l)
     (if (null? l)
         0
       (+ (add (cdr l)) (car l)))))

whereas this procedure results in a stack overflow:

 (define add
   (lambda l
     (if (null? l)
         0
       (+ (add (cdr l)) (car l)))))

the only difference being the designation of the formal parameter of the
anonymous procedure; l or (l).

Why is this?

Regards,

Sebastian



Reply via email to