Paul Rubin <http://[EMAIL PROTECTED]> writes:
>    (defun sum_to_n (n &optional (acc 0))
>       ;; (sum_to_n n) computes sum of integers from 0 to n
>       (if (= n 0)
>              0
>           (sum_to_n (- 1 n) (+ n acc))))

Of course meant:

    (defun sum_to_n (n &optional (acc 0))
       ;; (sum_to_n n) computes sum of integers from 0 to n
       (if (= n 0)
              acc
           (sum_to_n (- 1 n) (+ n acc))))

I've made that same error several times in Haskell as well.  I'm not
used to this.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to