Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!cvl!elsie!nih-csl!keith From: keith@nih-csl.UUCP (keith gorlen) Newsgroups: comp.lang.c++ Subject: Re: C++ Questions (Objective-C) Message-ID: <290@nih-csl.UUCP> Date: 27 Dec 87 22:57:51 GMT References: <2054@cup.portal.com> <2132@cup.portal.com> Organization: NIH-CSL, Bethesda, MD Lines: 54 Summary: Some corrections/comments on the OOPS library for C++ In article <2132@cup.portal.com>, Andre_Louis_Marquis@cup.portal.com writes: > >We are investigating the differences between Objective-C and C++. > > >What class libraries are available for C++? > Try getting a copy of Keith Gorlen's OOPS Library. It is perhaps even larger > than the Objective-C library, and there's no copyright restriction. ... The OOPS library is about where the Objective-C library was circa '84-'85. The current Objective-C library is much larger, and has an extensive set of classes for interactive graphics. > OOPS is > in the "guru-only" stage, but I found it as easy to use and it's free. > Mr. Gorlen's uucp address is uunet!mimsy!elsie!nih-csl!keith. Basically, > you send him a tape and he returns it with a copy of the library and some > preliminary documentation. Please do not do this! I'm trying to get out of the OOPS magtape distribution business. A new release of OOPS will be placed on the C++ tape that USENIX is preparing. Watch this newsgroup for an announcement! In the future, OOPS will be available via anonymous ftp. > >If I define a common superclass for all objects (Object), as > >others have mentioned, do I get the flexibility that Objective-C provides? > >Are there any problems with that strategy? Since C++ doesn't provide this > >capability directly, it seems to conflict with C++'s underlying philosophy. > OOPS defines a common class hierarchy. You may test object classes and > phyla. Virtual methods are inherited and can be overridden. Objective-C has "Smalltalk-style" messaging, C++ has "Simula-style" messaging. C++ messaging is safer and probably faster, Obj-C more flexible -- and dangerous. > >Is there any equivalent of [super foo] in C++? This allows method foo to > >invoke the inherited method that was overridden. > You just scope the name -- super_class::foo(). The disadvantage of this is that you must know the name of the base class, the advantage is that this extends easily to handle multiple inheritance. > >Are there any fundamental differences between the messagers, or is that > >simply an implementation issue? > There is no dynamic messaging in C++, i.e. no "perform: selector" message, but > normal messaging is faster. See above. -- Keith Gorlen phone: (301) 496-5363 Building 12A, Room 2017 uucp: uunet!mimsy!elsie!nih-csl!keith National Institutes of Health Bethesda, MD 20892