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

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Mar 6 19:36:02 EST 2008

Let me rephrase my answer:

The purpose of a class is to protect some invariant relationship  
among the fields and methods. When you don't have the source code of  
a class, how can  you be sure that "class appending" doesn't violate  
the relationships -- the original intent (to use an American term) --  
of the author(s)?

For many cases I suspect that class extension suffices.

Where it doesn't -- run-time replacement of broken code -- I think  
the 'no source' doesn't apply and you want an update protocol not a  
linguistic mechanism.

-- Matthias



Posted on the users mailing list.