www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - OT: Objective-C++

reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
In case anyone wonder what "Objective-C++" is,
it is the ultimate mongrel: the bastard child
of Objective-C and C++... Mostly useful for
writing wrappers to Objective-C system libraries
for use with C++ class libraries (on Mac OS X)

But you *could* write nice little programs like:

main.mm:
 #include <iostream>
 #import <Cocoa/Cocoa.h>
 using namespace std;
 int main()
 {
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 NSString *aString = [NSString stringWithString: "Hello, World!"];
 cout << [aString cString] << endl;
 [pool release];
 return 0;
 }

Operative keyword here being "can", not "want" :-) --anders PS. There even seems to be a D project: http://www.dsource.org/projects/docoa/ How about "Objective-D", anyone ? :-)
Mar 20 2005
next sibling parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Anders F Björklund" <afb algonet.se> wrote in message 
news:d1kscp$1du7$1 digitaldaemon.com...
 main.mm:
 #include <iostream>
 #import <Cocoa/Cocoa.h>
 using namespace std;
 int main()
 {
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 NSString *aString = [NSString stringWithString: "Hello, World!"];
 cout << [aString cString] << endl;
 [pool release];
 return 0;
 }


That's horrendous. :)
Mar 20 2005
prev sibling parent reply "Ben Hinkle" <ben.hinkle gmail.com> writes:
"Anders F Björklund" <afb algonet.se> wrote in message 
news:d1kscp$1du7$1 digitaldaemon.com...
 In case anyone wonder what "Objective-C++" is,
 it is the ultimate mongrel: the bastard child
 of Objective-C and C++... Mostly useful for
 writing wrappers to Objective-C system libraries
 for use with C++ class libraries (on Mac OS X)

Has Apple ever chosen the "right" language? Pascal... Object Pascal... Objective-C... maybe they are finally starting to come around. oh well :-P I just wish Dylan had worked out. Imagine a mainstream system API entirely in lisp - yikes.
Mar 20 2005
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Ben Hinkle wrote:

 Has Apple ever chosen the "right" language? Pascal... Object Pascal... 
 Objective-C... maybe they are finally starting to come around. oh well :-P

Not really, just that market forces made them support C++ and Java. The "preferred" language for all of NeXTStep is still Objective-C... (there's also the procedural API, Carbon, but that is Pascal-inspired C - not* C++, and there are of course the Java 1.4 JVM libraries too) * Unless you count the MacApp class library as a "system" library ? http://developer.apple.com/tools/macapp/ (no longer supported) Compared to ugly C++, Objective-C(++) is not that bad. But D is better Mac OS X also runs that Java clone by that other Monopoly company. ;-) --anders PS. Follow the rest of the D-for-Mac discussion in the D.gnu newsgroup.
Mar 20 2005