strange class creation behavior - compiler bug?

Bob Arning arning at charm.net
Tue Aug 27 14:57:15 UTC 2002


Ah! The snippets you included in your message were not enough to show it, but what probably happened is something like this:

You have a *class* method, perhaps #new:, that looks something like this

new: aString

	...maybe some stuff here...
	name _ aString.
	...maybe some stuff here...

If this had been an *instance* method, <name> would have been an instance variable, presumably, and all would be well. But as a *class* method, <name> is an instance variable of the *class*, so the assignment above actually renames the class. Hope this helps.

Cheers,
Bob

On Tue, 27 Aug 2002 10:10:16 -0400 "Larry White" <ljw1001 at hotmail.com> wrote:
>Thanks, I'll change the code and hope for the best.Ê However, it did actually create a class called 'house' which appeared in my class browser in a 'nil' category which it also created. It also modified some other classes: For example, a class appearing in my class browser asÊ'Room' has this for its definition - copied from the same class browser: 
>
>HouseÊsubclass: 'room 204'
>ÊinstanceVariableNames: 'building '
>ÊclassVariableNames: ''
>ÊpoolDictionaries: ''
>Êcategory: 'nil' 
>
>As you can see, the class of the super class is now House rather than Building and the class of the subclass is the string 'room 204' instead of the symbol #Room.ÊÊ(I had also instantiated an instance of Room named 'room 204' with the same result as I had with building but left this info off the original message. 




More information about the Squeak-dev mailing list