[squeak-dev] A Curious Method

Michael Haupt mhaupt at gmail.com
Mon Jul 12 07:30:14 UTC 2010


Hi Casey,

On Mon, Jul 12, 2010 at 9:04 AM, Casey Ransberger
<casey.obrien.r at gmail.com> wrote:
> There's no method tag / pragma here... so why does this method need three
> parameters? I see six implementers of the message, though... are the extra
> params there to deal with polymorphism without blowing up?

that message is part of the bytecode simulation protocol in
InstructionClient, which BlockStartLocator subclasses. In
InstructionClient, it's even empty. :-)

A "real" implementation is in ContextPart, where it actually does
something. In BlockStartLocator, the responsibility of bytecode
simulation methods is only to, well, locate block start PCs. (See
CompiledMethod >> #blockExtentsInto:from:to:scanner:numberer: for a
usage example.)

> If so, that's kind of interesting, because I hadn't recognized that pattern before.

The interface provided by InstructionClient should surely be provided
by subclasses. It *does* have an ever so faint smell, though. :-)

HTH,

Michael



More information about the Squeak-dev mailing list