[ENH] Message / Symbol / Block compatibility
Bert Freudenberg
bert at isgnw.CS.Uni-Magdeburg.De
Wed May 26 12:39:16 UTC 1999
On Wed, 26 May 1999, Marcel Weiher wrote:
> > From: merlyn at stonehenge.com (Randal L. Schwartz)
> >
> > >>>>> "Doug" == Doug Way <dway at 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
--
Bert Freudenberg Department of
Simulation and
Computer Graphics
http://isgwww.cs.uni-magdeburg.de/isg/bert.html Univ. of Magdeburg
More information about the Squeak-dev
mailing list
|