From: merlyn@stonehenge.com (Randal L. Schwartz)
"Doug" == Doug Way dway@mat.net writes:
Doug> I noticed one minor downside to the Trampoline versus the
other methods,
Doug> which is that you can't pass messages to it which Object
happens to
Doug> understand, such as 'asString' (since the Trampoline uses Doug> #doesNotUnderstand:). I wonder if there's any way around that.
Have it return an object instantiated with a class with a superclass of nil. Look at ObjectTracer (I think that's it) for an example that works.
Yes, I think that's what I did:
UndefinedObject subclass: #Trampoline instanceVariableNames: 'collection iterationMessage ' classVariableNames: '' poolDictionaries: '' category: 'Collections-Support'
This may have gotten mangled between fixing a typo and creating the changeset. I hope the new changeset is better.
Marcel
On Wed, 26 May 1999, Marcel Weiher wrote:
From: merlyn@stonehenge.com (Randal L. Schwartz)
> "Doug" == Doug Way dway@mat.net writes:
Doug> I noticed one minor downside to the Trampoline versus the
other methods,
Doug> which is that you can't pass messages to it which Object
happens to
Doug> understand, such as 'asString' (since the Trampoline uses Doug> #doesNotUnderstand:). I wonder if there's any way around that.
Have it return an object instantiated with a class with a superclass of nil. Look at ObjectTracer (I think that's it) for an example that works.
Yes, I think that's what I did:
UndefinedObject subclass: #Trampoline instanceVariableNames: 'collection iterationMessage ' classVariableNames: '' poolDictionaries: '' category: 'Collections-Support'
This is what you did, indeed - and you got it wrong. You have to subclass nil, not UndefinedObject. UndefinedObject is a Class, it inherits from Object.
See my message "[ADDON] Syntactic Sugar for Collections" from March 17 for how to do this ;-)
[To Squeak Central:] Why is it that in 2.4 #doesNotUnderstand: gets a message object where "lookupClass" is set - but there is no official way to set or reset this instance variable? This change makes it difficult to just forward the message to another object.
/bert
squeak-dev@lists.squeakfoundation.org