The Voodoo of Inlined Methods
RT Happe
rthappe at web.de
Thu Jun 27 17:36:17 UTC 2002
(I am new to Squeak, as you may guess anyway; using CocoaSqueak 3.2 with
the Squeak 3.0 final image).
The comment describing Number>>to:do: states that this method cannot be
overridden due to inlining. I construed this to refer to method
definitions on subclasses. However, the FAQ ``Message Sends Inlined by
the Compiler'' seems to imply that Squeak decides whether to compile a
message-send inline or not without regard to the class of the receiver,
and indeed, a selector lookup would be much easier to implement than a
class-inference algorithm. This would explain my wondrous experiences
when I tried to define and use Point>>to:do: (*), although Point isn't a
subclass of Number, the only (other) implementor of a #to:do: method.
My question: What's right?
rthappe
(*) By the way, the intended ``upLeft to: bottomRight do: aBlock''
iterates over the obvious rectangular grid consisting of all points p:
upLeft <= p <= bottomRight (with step 1 in each component and <= in the
sense defined by Point). For the time being, I've resigned myself to
using another selector.
More information about the Squeak-dev
mailing list
|