OOP languages use inheritance to simulate polymorphism, i.e to create a class of objects that can respond to a published list of messages. You can have polymorphism in Scheme without explicit inheritance because it is a dynamically typed language. Compare the implementation of an "Animal" class in Java and its corresponding implementation in Scheme:
// Animal interface and implementations in Java
interface Animal {
void cry (); // The only message to which an Animal object will respond.
}
class Cat implements Animal {
void cry () {
System.out.println ("meow!");
}
}
class Cow implements Animal {
void cry () {
System.out.println ("baee!");
}
}
// Usage
Animal a = new Cat ();
Animal b = new Cow ();
a.cry (); => "meow!"
b.cry (); => "baee!"
Now the corresponding implementation in Scheme using closures:
;; A factory of Animals.
(define (animal type)
(case type
((cat) (cat))
((cow) (cow))))
;; Corresponds to class Cat in Java.
(define (cat)
(lambda (msg)
(case msg
((cry) "meow!"))))
;; Corresponds to class Cow in Java.
(define (cow)
(lambda (msg)
(case msg
((cry) "baee!"))))
;; Sample usage
(define a (animal 'cat))
(define b (animal 'cow))
(a 'cry) => "meow!"
(b 'cry) => "baee!"
In fact we need closures only if we have to deal with too much private state. Scheme provide many ways to simulate simple "class hierarchies" like the above. Here is one method in which we develop a tiny "message dispatching" facility which we can use on a list of objects:
;; Generic message dispatch.
(define (send type message objects)
((cdr (assq message (cdr (assq type objects))))))
;; A list of animals.
(define animals (list (cons 'cat (list (cons 'cry (lambda () "meow!"))))
(cons 'cow (list (cons 'cry (lambda () "blaee!"))))))
;; Send a specific message to a specific animal:
(send 'cat 'cry animals) => "meow!"
(send 'cow 'cry animals) => "blaee!"
The functional abstraction mechanisms provided by Scheme is powerful enough to make us not worry about a full object system. Still, there are some object systems for Scheme. Have a look at Tiny-CLOS (based on CLOS). The book Lisp in Small Pieces discuss an implementation of an Object System for Scheme (based on Meroon).