[plt-scheme] "appending" to classes rather than extending
Matthias Felleisen <matthias at ccs.neu.edu> writes:
> 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)?
When you don't have the source code of a class, the author(s) of that
class is your enemy, and all is fair in war.
> For many cases I suspect that class extension suffices.
>
> Where it doesn't -- run-time replacement of broken code --
Indeed, live patching of bugs while waiting for a bug fix to ship in
the next version (or who knows, maybe the bug will never be fixed) is
much easier if you can do this kind of thing.
> I think the no source' doesn't apply and you want an update protocol
> not a linguistic mechanism.
Huh? Sounds interesting. Clarify?
-
Joe