On 28 May 2012 15:30, Ben Coman <[email protected]> wrote: > Mariano Martinez Peck wrote: >>>>>>> >>>>>>> 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! >>> > > > A passing naive thought... > Does ProtoObject then need #behavior? ...which can be overridden to return > Class, Metaclass or Other as appropriate? ...such that Mocketry, > #cannotInterpret and #pointsTo etc can use this instead of #class? > i dont have a strong opinion. from one side it is good to have a separate method for that, just to indicate that protoobject don't needs to have a fully formed class. from another side, its implementation will be same as in #class, and #behavior selector may be used already by various projects for different purposes.
> >>> - some object's behaviors are Classes >>> - some object's behaviors are Metaclasses >>> - but there could be any other. >>> >>> >>> >> >> I agree with all that. But as you said, I think you are going too low >> level >> in details. >> For example, I would call class to all your previous list. All objects >> have >> a class, which can be Class, Metaclass, whatever. >> In addition, if we don't add #class in ProtoObject, then there are some of >> broken messages like #cannotInterpret: and #pointsTo since they send >> #class >> to self. >> >> >> > > > > > -- Best regards, Igor Stasenko.
