discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isKindOf: - GSObjCIsKindOf


From: Marko Mikulicic
Subject: Re: isKindOf: - GSObjCIsKindOf
Date: Thu, 30 Aug 2001 14:59:50 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801

Stefan Böhringer wrote:
> On 30 Aug 2001 02:06:07 -0400, Marko Mikulicic wrote:
>
>>
>>Why duplicate the isMemberOf method and why deviate from the semantic
>>of the instance method isKindOfClass ?
>>
>
>
>>Objective-c is based on smalltalk and it seems very strange to me that
>>the concept of "kind" is so deviated, unless some important reason
>>induced this design decision. Somebody knows why ?
>>(Strange, I looked in the specs of OpenStep (on gnustep.org) and in the
>>docs of MacOSX and I didn't find a single word on isKindOfClass.)
>>
>
> You can find the documentation for +/-isKindOfClass: in the NSObject
> class and the NSObject protocal pages in the apple MacOSX docs. I just
> had a look two days ago when Nicola corrected me on this topic ;-)
>
> IIRC NextStep had only isKindOf: methods, no isMemberOf: method (method
> names used to be not as verbose as in OPENSTEP that time). isKindOf:
> checked for inheritance, both, for the class and the instance method. As
> to why the semantical change occured with OPENSTEP (or was it RDR1 ?) -
> I don't know, and it appeared very strange to me, as well as to others,
> since the class method can be trivially replaced by a simple comparison.

Now I understand. GNUstep implements alse the NextStep category of
NSObject, in which the is a isKindOf: method. The semantics of this

method should be the same as for NextStep. But the current
implementation uses isKindOfClass instead of directly using the runtime.
IMHO this should need a fix.

  Are NextStep compatibility methods going to be obsoleted and no more
supported ?



  I've looked on the OpenStep specs in the NSObject protocol
and there is only mentioned the instance method isKindOfClass: which
checks for inheritance.
  There is no word about the different behaviour for class and instance
methods.
I couldn't look at apple's documentation because their server is
rejecting me every second page ("forbidden"),
althrough if I remember well I seen the same.


Marko


PS:
I want to make additions in the gstep-db library and I don't want to
clutter code adding methods to NSObject (like the isSubclassOf proposal
of Nicola. Also a class is not a subclass of itself) if the same
functionality is accessible though the FoundationKit.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]