Description of Purely-functional

The present code implements a classless, delegation-based OO system, similar to those of Self or Javascript. This is a full-fledged OO system with encapsulation, object identity, inheritance and polymorphism. It is also a purely functional system: there is not a single assignment or other mutation in the code below.

Objects' identity is decided by an eq? predicate applied to the result of an identity message. A set-x method returns an object with a new state, but with the same identity as the source object. An object in a changed state is in a sense a "child" of the original object. No wonder implementations of "mutation" and inheritance are so similar in this OO system.

This was also Discussed on Usenet and this is the inital message

http://okmij.org/ftp/Scheme/oop-in-fp.txt .

The current version is found at http://okmij.org/ftp/Scheme/#pure-oo

category-object-oriented category-software