University of Virginia, Department of Computer Science
CS200: Computer Science, Spring 2003

Notes: Friday 14 March 2003
Schedule

(define (make-ocounter)
  ((lambda (count)
     (lambda (message)
       (if (eq? message 'reset)
	   (set! count 0)
	   (if (eq? message 'next) 
	       (set! count (+ 1 count))
	       (if (eq? message 'how-many)
		   count)))))
   0))
(define (make-ocounter)
  (let ((count 0))
    (lambda (message)
      (if (eq? message 'reset) 
	  (set! count 0)
	  (if (eq? message 'next) 
	      (set! count (+ 1 count))
	      (if (eq? message 'how-many)
		  count))))))
What is an object?





How to Smalltalk-ers add 2 + 3?




Why is it useful to package state and procedures together?






Recommended Reading: Howard Rheingold, Tools for Thought, Chapter 11: The Birth of the Fantasy Amplifier.

The best way to predict the future is to invent it. — Alan Kay
If you have an idea, and its not a good idea, take a nap instead of implementing it. — Alan Kay

CS 200


CS 200: Computer Science
Department of Computer Science
University of Virginia

Circle Fractal by Ramsey Arnaoot and Qi Wang

cs200-staff@cs.virginia.edu
Using these Materials