[ deleted ] I found this work very interesting. One of the things I liked most was how message reception was devided into two phases: the lookup where the object ( really the meta-object, but let's ignore that ) decides which of its slots is refered to by the message selector, and the apply where the result of the lookup does something according to its nature.
[ more deleted ]
I would not complicate the implementation for consistency unless there was a real gain. I can imagine some pretty useless stuff ( I suggested method parents about two years ago :-) :
Background: I'm a near-lurker on this list. I do Objective-C programming for the NeXT. One of the nicest aspects of Obj-C is the (true) dynamic binding, and the run-time class creation, loading, and general mayhem that is possible.
One benefit that I can see to the two-phase approach is the possibility of implementing a conscience for an object. Namely, "Normally, I implement all setPosition:: messages, but when the system is in a 'panic' state, I ignore them." (implying that "setPosition::" is a family of messages, and you don't want to put the same state checking code in each one)
Objective-C provides capabilities to do this, but it would be a bit of a hack.
Does this sound useful? Have people experimented with this?
--- Bruce McKenzie (spuds@netcom.com, NeXTMail welcome) Atlas Software Ventures, Inc. PO Box 1299, Santa Clara, CA 95052-1299 800/278-9909 (ASV-9909) *** Software Development, specializing in NEXTSTEP *** ---
**> On Tue, 19 Jul 94 16:46:53 -0700, Bruce McKenzie bruce@trwlasd.com said: [ more deleted ]
I would not complicate the implementation for consistency unless there was a real gain. I can imagine some pretty useless stuff ( I suggested method parents about two years ago :-) :
[deleted] Bruce> possibility of implementing a conscience for an object. Namely, Bruce> "Normally, I implement all setPosition:: messages, but when the system Bruce> is in a 'panic' state, I ignore them." (implying that "setPosition::" Bruce> is a family of messages, and you don't want to put the same state Bruce> checking code in each one)
Bruce> Objective-C provides capabilities to do this, but it would be a bit of Bruce> a hack.
Bruce> Does this sound useful? Have people experimented with this?
Oh yes, it's useful. It can be used in time-critical computing scenarios to handle different ways of implementing things -- e.g., the fast-but-sloppy way versus the slow-but-accurate way. For example, when showing an animation, you might want to keep the frame rate consistent. So, if the frame rate falls behind, you simply tell the thing displaying the frames to use a faster method (by telling it to use a new parent) of getting the frames onto the screen (e.g., half as many bits, or don't do it at all). When the time becomes available, change the parent again, back to the slow way of putting the entire frame on the screen.
Something like this (using your "panic" idea) (excuse the syntax -- consider this semi-pseudocode):
noPanicWay = (| setPosition <- aPoint |) panicWay = (| setPosition. setPosition: foo = (|| self) "Ignore the argument and don't assign" |) myPanicSafeObject = (| parent* <- noPanicWay. panic = (|| parent: panicWay ). unpanic = (|| parent: noPanicWay ) |)
Now, when you tell myPanicSafeObject to panic, it starts ignoring assignments. When you unpanic it, it starts performing assignments.
Brook
self-interest@lists.selflanguage.org