[comp.sys.next] Mixing C++ with Objective-C

bnfb@cs.washington.edu (Bjorn Freeman-Benson) (10/07/90)

I was glancing through the latest NeXT documents when I saw that
they have C++ as well as Objective-C available.  For the C++
community, this raises the question of whether adding Objective-C
would be a good idea for all C++ releases (to provide dynamic
binding).  For the NeXT community, this raises the question of
whether it is needed/useful.

I don't know, maybe you can tell me...
Bjorn N. Freeman-Benson

P.S. Another question I have is whether the same class can be used
both as a C++ class and as an Objective-C class.

rock@lighthouse.com (10/08/90)

In article <13275@june.cs.washington.edu> bnfb@cs.washington.edu
(Bjorn Freeman-Benson) writes:

>I was glancing through the latest NeXT documents when I saw that
>they have C++ as well as Objective-C available.  For the C++
>community, this raises the question of whether adding Objective-C
>would be a good idea for all C++ releases (to provide dynamic
>binding).  For the NeXT community, this raises the question of
>whether it is needed/useful.

Mostly for market reasons, the NeXT community benefits from the
addition of C++. It makes the machine attractive to more people.

While the flexibility of choice seems like a good thing to me, I don't
see any vastly compelling reasons for all C++ compiler makers to add
Objective-C support. 

It is interesting to note that the upcoming version of gcc is supposed
to compile both, just like the NeXT compiler.

>P.S. Another question I have is whether the same class can be used
>both as a C++ class and as an Objective-C class.

One of our engineers wrote a demo in which Objective-C methods sent
messages to C++ objects and vice versa. Such code looks perverse at
best, but it works just fine. 

BTW, I've heard a rumor that the internals of Improv are written in
C++.

Roger Rosner
Lighthouse Design
rock@lighthouse.com

No one would be foolish enough to take responsibility for my opinions.