On 23 May 2010 16:38, Joachim Geidel <joachim.geidel@onlinehome.de> wrote:
Am 23.05.10 15:15 schrieb Igor Stasenko:
Do you really need to create a meta? > > If not , then you can do just: >
newClass := Rectangle clone. > newClass > Â Â superclass: Rectangle; > Â Â organization: nil; > Â Â methodDict: MethodDictionary new. Unfortunately, this doesnât solve the problem:
| newClass method | newClass := Rectangle clone. newClass   superclass: Rectangle;   organization: nil;   methodDict: MethodDictionary new;   setName: #MyRectangle. newClass new class name. "--> #Rectangle" newClass new class == newClass. "--> false"
^^^ That's really strange. Have you tried to debug it?
method := (newClass compile: 'testGhost ^42'         classified: nil         notifying: nil         trailer: newClass defaultMethodTrailer         ifFail: [nil]) method. newClass addSelectorSilently: #testGhost withMethod: method. newClass canUnderstand: #testGhost. "--> true". newClass new respondsTo: #testGhost. "--> false" newClass new testGhost. "--> Message not understood, should answer 42"
The problem is not the MetaClass (I do need it), but that the new class doesnât create instances of itself, which I find very, very strange.
Best regards, Joachim Geidel
_______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
-- Best regards, Igor Stasenko AKA sig.