[plt-scheme] "appending" to classes rather than extending

From: Doug Orleans (dougorleans at gmail.com)
Date: Thu Mar 6 22:54:06 EST 2008

Matthias Felleisen writes:
 > The purpose of a class is to protect some invariant relationship  
 > among the fields and methods.

The purpose of a module is to protect invariant relationships.  The
purpose of a class is polymorphism and inheritance.  That's how I see
it, anyway.  Of course, many languages don't have modules, so they use
classes for encapsulation too.  In PLT Scheme, what does the
encapsulation of classes give you that modules and units don't already
provide?  (This is not a rhetorical question-- I suspect that there is
something different about class encapsulation, but I'm not sure what
it is.)

--dougorleans at gmail.com


Posted on the users mailing list.