[plt-scheme] Re: overriding fields
At Mon, 11 Apr 2005 16:32:54 -0500, Corey Sweeney wrote:
> i just found this is the manual:
> * overriding: Some methods declared in a superclass can be replaced in
> the derived class. References to the overridden method in the
> superclass use the implementation in the derived class.
>
> is this example what the manual is refering to?
Yes.
You can get the same effect as your commented-out code by using
`rename-super' (in v299, just `rename' in v20x):
(define b-mixin
(mixin (thing<%>) (thing<%>)
(rename-super [super-the-call the-call])
(define/public (call-this) (lambda () (super-the-call)))
(super-new (stuff "inside"))))
Matthew