Section08 - Section Notes 8 CS51-Spring 2009 Week of March 2 2009 Outline 1 Box and Pointer Diagrams 2 OO Practice 1 Goals for today 1 Understand

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Section Notes 8 CS51—Spring 2009 Week of March 2, 2009 Outline 1. Box and Pointer Diagrams 2. OO Practice 1 Goals for today: At the end of today’s section, you should be able to do the following: 1. Understand mcons, set-mcar! and set-mcdr!. 2. Draw a box and pointer diagram for lists. 3. Be able to understand an implement basic objects with inheritance 2 Box and Pointers A box and pointer diagram is a visual representation of a cons cell. a single empty cons cell as a box and pointer diagram 2.1 Representing Structures Lists can be represented like this: (list 1 2 3) as a box and pointer diagram Draw the following lists with box an pointer diagrams: 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(list (list "hi" "hello") "good-evening") (list (list "cars" "trucks" "buses") (cons empty (list "traffic" "light"))) (list (list (list (list empty) empty empty) empty)) 2.2 Mutable lists in PLT Scheme In the dialect of Scheme that we are using, normal cons is not mutable. However, we are provided with mcons, mcar, and mcdr , which are mutable. How does
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/26/2009 for the course COMPUTERSC CS51 taught by Professor Gregmorrisett during the Spring '09 term at Harvard.

Page1 / 6

Section08 - Section Notes 8 CS51-Spring 2009 Week of March 2 2009 Outline 1 Box and Pointer Diagrams 2 OO Practice 1 Goals for today 1 Understand

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online