[BUG?] ProtoObject class superclass = nil
Torge Husfeldt
jean-jacques.gelee at gmx.de
Mon May 27 10:15:53 UTC 2002
Hi Andrew,
"Andrew P. Black" wrote:
>
> At 7:32 -0700 05/23/2002, Dan Rozenfarb wrote:
[snip]
>
> If you do a "printIt" on
>
> ProtoObject class superclass
>
> you will indeed get
>
> Class
>
> as you expect.
>
> However, if you inspect ProtoObject, you get an inspector window
> headed "ProtoObject class", and if you look at the instance variable
> superclass, it is indeed nil.
>
> The confusion arises because the heading on an inspector window is
> the *class* of the object that you are inspecting, which is not the
> same as the object that you are inspecting. So, if you inspect
> 'abc', the inspector window is headed "String", and if you inspect
> String the inspector window is headed "String class".
>
> Hence, if you inspect
>
> ProtoObject class
>
> you get an inspector with the heading Metaclass. Its superclass
> instance variable is indeed Class.
>
> We might reduce the confusion a bit if the heading on the Inspector
> window was the result of "printOn:" on the object, i.e., what is
> displayed in the self slot of the inspector. You can change this if
> you wish, by redefining Object>>defaultLabelForInspector . Of
> course, if you do this and your students don't, the confusion might
> actually increase ...
>
> Andrew
This is a bit curious, because I always thought that the
defaultLabelForInspector would be the version with an article like:
a String, an Object ...
a String class ...
but you're right of course, i just checked in my image. Is this just my
memory failing me or has this changed recently? If so why? Would it be
accepted as a good idea to adopt such a version? I disaccount for the
printString as default label for two reasons:
i: printStrings tend to get long
ii: printStrings can sometimes call walkbacks and you don't want to
check for that when constructing the WindowTitle.
Attached is a changeset to do this so you might try (sorry, this is
already modules aware).
So long,
Torge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: articles.1.cs
Type: application/x-squeak-source
Size: 2438 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020527/d895dc63/articles.1.sts
More information about the Squeak-dev
mailing list
|