[plt-scheme] solution for exercise 11.2.4

From: John Clements (clements at brinckerhoff.org)
Date: Mon Jun 9 19:45:15 EDT 2008

On Jun 9, 2008, at 3:53 PM, carlo ambrogio wrote:

> the template could be:
> (define (depth a-dl)
>  (cond
>    [(symbol? a-dl) ...]
>    [else ... (first a-dl) ... (depth (rest a-dl)) ...]))

If I recall the data definition you just posted correctly, this  
doesn't match it.  Which elements of the data definition are self- 
referential?  What does this imply about the template?

> how many clauses does the data def have? (how many clauses must the
> function def have?)
> I think 2 (the data can be a symbol or a list)

Yes, this part looks correct to me. It looks to me like you got the  
right number of clauses and the right number of pieces in each clause;  
it's just the very last step that needs fixing.

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20080609/8143f2b1/attachment.p7s>

Posted on the users mailing list.