On Wed, Apr 15, 2009 at 10:29 AM, spir <
denis.spir@...> wrote:
> I would rather ask the opposite question: in which (real world and/or theoretical) case can one expect the parent methods to change *and* wish this change to propagate to clones?
I'm not sure why you're asking me this.
This line of questioning is ultimately meaningless in a fully dynamic,
prototypical model as Io, precisely because you ultimately have no
control over whether or not it happens. It would make more sense in a
language with statically delineated interfaces that, once the
compilation unit is done with, remains static throughout the rest of
the runtime.
Consider if you're writing an application in Io, and you find two
libraries (one written by me, one by Jeremy), which individually you
find very useful in your work.
You obviously have no express intent on tweaking Math. But suppose
both my library and Jeremy's tweaks Math in some individually useful,
but mutually exclusive, way as a private means of implementation.
Presumably, YOUR code depends on Math's default behavior; you're
unaware that either of our libraries tweaks Math without looking at
the source code.
What do you do? What do we do?
Obviously, the best solution is for both of us to clone Math, convert
them to a mixin, then tweak as appropriate. That way, our individual
changes remain private to our respective libraries, without altering
the public environment your code depends on.
You might say, "But wait! You can just rely on Io's differential
inheritance to isolate your changes!" Correct -- but it does NOT
isolate YOUR changes from our expectations of Math. If you alter Math
directly, then our libraries' understanding of Math's interface might
change in an incompatible way.
Again, this is a horribly contrived example, and is certainly not
idiomatic. This is why I asked for those interested to investigate
how CLU and/or Sather utilized mixins because their literature is more
mature on the subject.
--
Samuel A. Falvo II