Can I create a class at Runtime? I want to define a class this way
MyObject class: #newclass
so that myobject MyObject has the class message class: that return a new instance of newclass (but newclass is never devfined before.) I think i can write
class: #aSymbol
^ SuperClass subclass: #newclass instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''.
that's true? it gives to me some errors... it seems that newclass can't receive messages that SuperClass accepts....
thanks for any advice, nelson
"nelson -" nelson1977@gmail.com wrote:
I have solved....
So did I :-)
I looked at the template the System Browser is providing if you select a category:
Object subclass: #NameOfSubclass instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'ST80-Editors'
This is a message to be sent to the super class of your new class. (In the template it happens to be Object.) The message is implemented in class Class. Consult the System Browser (Kernel-Classes | Class | subclass creation) for other messages you might use to create classes.
I missed category:'' in this statement.... But i can't declare a class without declaring a category?
Regards, Wolfgang
squeak-dev@lists.squeakfoundation.org