[REBOL] Objects, Inheritance and Barking Up Wrong Trees?
From: scott:dunlop:nextel at: 25-Apr-2001 23:02
I am currently trying to determine the best way to override an object
method; at the moment, I've been doing the obvious thing, copying the
function into a new binding:
ss-histfield: stylize [
histfield: field with [
feel: make feel [
old-engage: get 'engage
engage: func [face act event index][
switch/default act [
; << Special Case Code Here >>
] [
old-engage face act event index
]
]
]
]
]
While this works, it is more brittle than I would like, since the old-engage
binding isn't private to histfield's feel, and could collide with a child
trying to do a similar thing, or revisions to the field feel. Does anyone
have a simpler / better solution for doing this?
Btw, I am aware that there is probably another way to override feel/engage,
but this is one of two sticking points that my Python-oriented mind tends to
get hung up on. The other is my addiction to Dictionaries.
--Scott.