exer 11.2.4

4 views
Skip to first unread message

mike

unread,
Oct 30, 2008, 10:37:39 PM10/30/08
to Study-HTDP
Wow ! this exercise was difficult, my brain is fryed! Since a deepl-
list may contain list which contains list (i will assume
that the list has symbols as elements as well). one had to look
at the (first l) and the (rest l). here is the code:
(define (refined-depth l)
(cond
((empty? l) 0)
((symbol? (first l)) (add1 (refined-depth (rest l))))
(else
(+ (add1 (refined-depth (first l))) (refined-depth (rest l))))))

this problem was definitely a curve ball.

Grant Rettke

unread,
Oct 31, 2008, 5:13:43 PM10/31/08
to Study-HTDP
Haven't reached it yet... can't wait!
Reply all
Reply to author
Forward
0 new messages