[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5.1 OO languages: set up

Setup

Perform the weekly set up instructions for project 2, homework a.

What to hand in

Report (a) all the lisp functions you’ve written and (b) a file containing your deftests for all parts of the following and (c) ‘repl.txt’ coming from you saving the REPL showing the dance hall walking and running (defined below).

Exercise 1: RT*M

Read the user guide for GOLD.

IMPORTANT: for this week, you do NOT need to know the internal details of how GOLD is implemented. If you want, you can read that code (heh, its only a 100 lines). And we’ll be walking through that implementation in class, later in the semester.

Exercise 2: Implement a dance hall

Let *Person* be a sub-class of *Object* with arms, feets, head, and an urge to dance and jump.

Person                (has "dob", does "walk")
     Male             (does "jump")
          OldMale     (does "dance" by  calling jump twice)
          YoungMale   (does "dance" by calling jump 10 times)
     Female           (does "dance" and "jump")

Note: old men jump the same way young men do (just not as often).

The examples section of the user guide offers examples of how to (i) create a class, (ii) create an instance, (iii) define a method, and (iv) define an initialization method (don’t worry about extending a super-class method: we’ll get to that later). Write one deftest for (i,ii,iii,iv) showing that for *Person* you can code all that.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 19, 2011 using texi2html 5.0.