Counting elements of a list and sublists
问题 I'm trying to create a function to count all the elements in a list, including the elements of its sublists. initially, to get started, i came up with a basic function myList : (define myLength (lambda (L) (cond ((null? L) 0) (else (+ 1 (myLength (cdr L))))))) However, it doesn't help me account for function calls like: (numAtoms '()) "...should be 0" (numAtoms '(())) "...should be 0" (numAtoms '(1 1)) "...should be 2" (numAtoms '(1 (1 1) 1)) "...should be 4" (numAtoms '(1 (1 (1 1)) 1)) "..