On 27 May 2012 14:46, Mariano Martinez Peck <[email protected]> wrote: > > > On Sun, May 27, 2012 at 2:31 PM, Igor Stasenko <[email protected]> wrote: >> >> On 27 May 2012 11:40, Mariano Martinez Peck <[email protected]> wrote: >> > >> > >> > On Sun, May 27, 2012 at 11:02 AM, Denis Kudriashov >> > <[email protected]> >> > wrote: >> >> >> >> I found problem. >> >> >> >> Proxy classes in SMock and Mocketry are subclasses of ProtoObject which >> >> not implements #class. >> >> But proxy classes use "self class" in some methods (like #printOn: >> >> implementation). >> >> >> >> I add #class implementation from Object to ProtoObject and all SMock >> >> and >> >> Mocketry tests become green. >> >> >> >> So questions: >> >> Is ProtoObject should implement #class? >> >> Can we move #class method from Object to ProtoObject? >> >> >> > >> > ups....good catch! indeed, we should move it to ProtoObject. >> > >> mm.. why? > > > Because ALL objects do have a class. Right? if you want to change the > semantics of #class then just subclass and change it.
mmm.. no. IMO, in pure sense, all objects having behavior. but behavior is not a class (and we can even have two classes to discriminate between them). yes, it is _almost_ a class.. but much more obscure.. i doesn't needs to be compatible with Class protocol.. You should know pretty well, what requirements VM side puts for a valid behavior: - superclass, methoddict, format. which enables VM to do method lookup and creating an instances. now, if you make ProtoObject to answer message #class, one will assume that the object it answers should conform to a full-fledged Class protocol. But of course it should not. Maybe i nitpicking about terminology.. but i think at that level we should make it clear: - all objects having behavior! - some object's behaviors are Classes - some object's behaviors are Metaclasses - but there could be any other. > This is not the real reason, but in addition because since previously #class > used to have a special bytecode, it means it was understood by "everybody". > So at least with this we don't break anything. > For me it does not make sense to get a #dnu for #class when the object > really has a class. > >> >> the more we put to ProtoObject, the more it looks like Object. >> at some point you will see not difference between them, and then >> someone will come >> with a brilliant idea of having one more "clean" class ahead - >> ProtoProtoObject. >> > > You cannot tell that to me ;) I was the one who spent 2 days to remove all > the 10 menthods tryNamedPrimitive* from ProtoObject. > yes :) >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > > > -- > Mariano > http://marianopeck.wordpress.com > -- Best regards, Igor Stasenko.
