Execise 1.31 1.32 1.33

85 views
Skip to first unread message

David Ben David

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


Mitchell Wand

unread,
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 <tig...@gmail.com> 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.
Visit this group at http://groups.google.com/group/eopl3.
For more options, visit https://groups.google.com/d/optout.

David Ben David

unread,
Apr 2, 2014, 3:13:59 PM4/2/14
to eo...@googlegroups.com
Thanks.

пятница, 21 марта 2014 г., 19:55:06 UTC+2 пользователь Mitch написал:
Reply all
Reply to author
Forward
0 new messages