Object-oriented programming

What is object-oriented programming?

The term object-oriented programming can mean different things depending on who you ask.

The static school is taught to most programmers at vocational schools and universities. It descends from Simula through C++ and Java, and puts an emphasis on objects, which are instances of classes, which inherit from other classes. A static object-oriented program is like a taxonomy — a hierarchy of all the classes and subclasses in its problem domain.

The dynamic school, exemplified by the Smalltalk programming language and its descendants, puts an emphasis on message-passing between objects. A dynamic object-oriented program is like a network, with each object being a node (like a neuron, a computer, or a person) and messages being signals between them.

The Lisp family has traditionally been a flag bearer of dynamic languages, and this shows in its approach to object-oriented programming as well. Practically all Lisp dialects that have an object system, have a very dynamic one.

A bried history of objects in Lisp and Scheme

Is Lisp inherently OOP?

Lisp, and hence Scheme, is fundamentally object-oriented in the sense that all values are "first-class" objects, you can pass them to around and call procedures on them.

What’s missing from this picture is that message-passing is not built into the core language. Sending a message is just like calling a procedure, except for how the procedure is selected. A particular Scheme/Lisp identifier refers to the procedure that it is bound to. By contrast, a Smalltalk-style message send can select its receiver based on complex class and metaclass relationships.

Closures

Flavors and New Flavors

CLOS (Common Lisp Object System)

MOP (Meta-Object Protocol)

TinyCLOS (STklos, Gauche)

COOPS (Chicken CLOS)

Java/C# interop

Contributing

doc.scheme.org is a community subdomain of scheme.org.