[squeak-dev] Multiple issues with class definition

Igor Stasenko siguctua at gmail.com
Fri Apr 10 09:34:35 UTC 2009


I just found, that when i tried to redefine previously declared
regular class to a variable one,
the ClassBuilder bugs me with error, that 'class can't be recompiled'.

Just two doits to reproduce the problem:

Object subclass: #Blabla
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Whatever'.

Object variableSubclass: #Blabla
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Whatever'.

i wonder what the reason of preventing me to redefine a mistakenly
defined class, which having 0 methods? And even if i have the methods,
so what?
I think that this limitation is too strict.
I find it quite inconvenient , since now, to redefine a class, i have
to rename old one, then define a new one which is variable from a
start and then manually copy methods from old one.


Another funny thing that i found, that you can actually do:

| string |
string := 'Blabla'.
Object subclass: string
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Whatever'.

Smalltalk at: string " returns a class you just defined."

Its fun, but having no sense. What is interesting that OB can display
this class (but not in a regular way, you can find it in smart groups
pane, after searching for 'Blabla').

The above is true for both 3.10 and  Pharo-10178 (and i think a more
recent Pharo have same behavior).


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list