« Return to Thread: Real (trivial) mixins

Re: Real (trivial) mixins

by Jeremy Tregunna-2 :: Rate this Message:

Reply to Author | View in Thread


On 15-Apr-09, at 1:04 PM, Samuel A. Falvo II wrote:

> On Wed, Apr 15, 2009 at 9:55 AM, Guy Hulbert <gwhulbert@...> wrote:
>> Also, could you easily change the mixin design so that the change to
>> Math would automatically propagate to Foo?
>
> Simply clone Math, but do not invoke asMixin.

An example:

Foo := Object clone do(prependProto(Math); ...)

Foo add(2, 3) == 5 // before replacing Math add
Foo add(2, 3) == 6 // after replacing Math add with the multiplication  
example earlier

Regards,

Jeremy Tregunna
jeremy.tregunna@...



 « Return to Thread: Real (trivial) mixins