« Return to Thread: Real (trivial) mixins

Re: Real (trivial) mixins

by Guy Hulbert :: Rate this Message:

Reply to Author | View in Thread

On Wed, 2009-15-04 at 12:43 -0400, Jeremy Tregunna wrote:
> And run Foo add(2, 3) again, we'll notice it still returns 5, while
> Math add(2, 3) returns 6 (since it's now doing multiplication instead
> of addition).

Hmm.. can you explain a bit more -- *why* you would want to do this.
It's useful to know that this is how Io behaves but it's not obvious to
me why it's useful.  There must be some "real world" example.

Also, could you easily change the mixin design so that the change to
Math would automatically propagate to Foo?  I think it would be easy but
I have not yet managed to collect enough tuits to start learning Io.

tq

--
--gh


 « Return to Thread: Real (trivial) mixins