[Solved] Write scheme LISP Atomic_Count [closed]
Not too hard, the main point is that you need some kind of buffer (called prev in my case) to wait for a possible multiplication: (define (atomic_count lst) (let loop ((lst lst) (prev 0)) (if (null? lst) prev (let ((elt (car lst))) (cond ((list? elt) (+ prev (loop (cdr lst) (loop elt 0)))) ((number? elt) … Read more