CaretForm mystery

Matthew Rosen rosen at sjdccd.cc.ca.us
Tue Feb 3 01:05:53 UTC 1998


I'm _very_ puzzled about a strange little critter in the Squeak 1.30
image (and earlier images for that matter).  I ran across it in the
method:

Paragraph>>caretFormForDepth:

The top part of the method reads as follows:

caretFormForDepth: depth
 "Return a caret form for the given depth."
 "(Paragraph new caretFormForDepth: Display depth) displayOn: Display
at: 0 at 0 rule: Form reverse"

 | box f bb map |
 box _ CaretForm boundingBox.
 f _ Form extent: box extent depth: depth.
....and so on...

The puzzling critter is CaretForm.

It looks like it should be a class variable, but it is not defined as
one in Paragraph or any of its superclasses.  It is not a class instance
variable either.  It doesn't show up as a global in the Smalltalk
dictionary.  The explain message says that it can't explain it.
Selecting CaretForm and inspecting it tells you that it is an undeclared
variable, and suggests some corrected spellings, but no object for it.
Despite all of this, you can run the example in the method comment, and
it works perfectly!  You can step through with a debugger, and CaretForm
responds happily to methods intended for Form instances.  Of course, now
it shows up in my Undeclared dictionary, and there are (naturally) no
references to it when you ask.

Granted, I only have eight years of Smalltalk experience, but even I
know that something outside the normal Smalltalk rules is happening
here.

Please, I want to sleep nights again.  Can someone shed light on this
mysterious phenomena?

--
Matt Rosen, Director for Technical Services
San Joaquin Delta College





More information about the Squeak-dev mailing list