I have two definitions, for a family tree and a person.
; a family-tree is:
; (make-person list-of-family-tree symbol number symbol)
; a person is:
; (define-struct person [children name date eyes])
I need to make a "mutually recursive" function that counts the number of descendants in a tree (including the person). But I can't figure out how to make cond do more than one thing if a condition is met.
i.e.:
(define (count-descendants person1)
(cond [(empty? (person-children person1)) +0]
[else (count-descendants (first (person-children person1)))/*also +1 here*/
(count-descendants (rest (person-children person1)))/*also +1 here*/]))
Any idea how to recursively call the function on the other parts of the list, AND add one?