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

A poor man's object system



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
simple.

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.

 

--
Joo