[plt-scheme] overriding fields

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Mon Apr 11 16:03:48 EDT 2005

i'm having some trouble trying to override fields.  i tried thowing
the field as a closure in a let, and then just provide accessors, but
it's still not working. the problem is:

a% -> (define/public (get-thing))

b% (inherits from a%) -> (define/public (somefunction) ...(get-thing)...)

c% (inherits from b%) -> (override* (define-public (get-thing)))

my problem is that when i call (send b somefunction), (get-thing)
references the data in it's subclass c%, not it's superclass a%.  is
there a special mechanism that i have to use for overriding fields?


Posted on the users mailing list.