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@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
Please, I want to sleep nights again. Can someone shed light on this mysterious phenomena?
CaretForm is part of TextConstants, a pool dictionary which has been emptied in the 1.3 release for mysterious reasons ;-) You can recreate the TextConstants by doing "Text initialize" which will also bring back CaretForm.
Hope this helps, Andreas
Matthew Rosen writes:
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: [...typical my-pool-has-lost-its-association symptoms...]
The solution to your mystery used to lie in the TextConstants pool that Paragraph is using. As it has been discussed here, the pool is damaged in 1.3, with all the Associations it used to contain lost. Recompilation, inspection, and explain do not work because of that (the compiler cannot find the name anymore).
The method still runs fine because the CompiledMethod object still references the Association that used to be in the pool. Inspect
(Paragraph compiledMethodAt: #caretFormForDepth:) literals
and you will see "CaretForm->a Form" somewhere in the result.
The pool is OK in 1.23 image, BTW, and explain and everything else works.
Granted, I only have eight years of Smalltalk experience, but even I know that something outside the normal Smalltalk rules is happening here.
This is a normal Smalltalk behavior in abnormal cirumstances. :-)
<...painfully struggling against the temptation to comment on the reference to years as a measure of knowledge...>
Please, I want to sleep nights again. Can someone shed light on this mysterious phenomena?
Good night, (don't let the Squeak bugs bite)
--Vassili
squeak-dev@lists.squeakfoundation.org