[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A poor man's object system

This page is part of the web mail archives of SRFI 100 from before July 7th, 2015. The new archives for SRFI 100 contain all messages, not just those from before July 7th, 2015.

Though I said in 'abstract' that the macro extends DEFINE-RECORD-TYPE (SRFI 9)
in being more general but much less general than DEFCLASS (CLOS), this macro
actually was for a sort of poor man's object system whose user interface is

For instance, the slot options such as init-value, init-form, init-thunk are
not necessary because all the fields (except virtual fields) of a lambda
object are initialized at the time it is made by a constructor.  The other
slot options such as init-keyword, getter, setter, accessor, slot-ref, and
slot-set! are also unnecessary in this macro because the lambda object plays
the role of the accessor and mutator of each field.  In contrast to CLOS, a
field sees the values of all the previous fields, and lambda-objects can be
constructed even though their group name is changed into others.  In addition,
even though all for the group are changed or destroyed, they can be reproduced
if only one lambda object exists.