# Execise 1.31 1.32 1.33

87 views

### David Ben David

Mar 19, 2014, 7:31:36 PM3/19/14
What need do contents-of?
(contents-of '(red (bin (dean 1 2) 2) (sean 1 (chean 1 2)))) -> ?

### Mitchell Wand

Mar 21, 2014, 1:55:06 PM3/21/14
to eopl3
These exercises refer to Definition 1.1.7, which says

Bintree := Int | (Symbol Bintree Bintree)

I believe what's intended here is that contents-of should return the contents of a leaf, or the symbol of an interior node.  So we should have:

(contents-of 37) = 37

(contents-of  '(red (bin (dean 1 2) 2) (sean 1 (chean 1 2)))) = red
(lson         '(red (bin (dean 1 2) 2) (sean 1 (chean 1 2)))) = (bin (dean 1 2) 2)
(rson         '(red (bin (dean 1 2) 2) (sean 1 (chean 1 2)))) = (sean 1 (chean 1 2))

--Prof. Wand

On Wed, Mar 19, 2014 at 7:31 PM, David Ben David wrote:
What need do contents-of?
(contents-of '(red (bin (dean 1 2) 2) (sean 1 (chean 1 2)))) -> ?

--
You received this message because you are subscribed to the Google Groups "EOPL3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eopl3+un...@googlegroups.com.
To post to this group, send email to eo...@googlegroups.com.