Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!tut.cis.ohio-state.edu!mailrus!sharkey!mcf!mibte!gamma!thumper!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: Any interest in making C++ a real superset of ANSI C? Message-ID: <9395@alice.UUCP> Date: 26 May 89 23:02:47 GMT References: <7435@hoptoad.uucp> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 43 In article <7435@hoptoad.uucp>, gnu@hoptoad.uucp (John Gilmore) writes: > I think C++ would be a lot better language if it was a superset of ANSI > C. I can get along with stealing a few identifiers as new keywords, > like "class". But the gross change that makes "struct foo {...};" > equivalent to "typedef struct foo {...} foo;" is too much to bear. Really? Exactly what about it is unbearable? > Surely the burden of incompatability is too high a price to pay, when > the solution is simple: either writing "struct/union/class/enum foo" > when you declare a "foo", or explicitly coding a typedef yourself in > the header file, if you like typedefs. Here's an example of why C++ does it the way it does. class Complex { private: double r, i; public: Complex(double rr = 0,double ii=0) { r = rr; i = ii; } // and so on }; It is much more convenient to be able to write Complex z (3, 4); z += Complex (1, -1); than it would be to write class Complex z (3, 4); z += class Complex (1, -1); Classes are the central concept in C++; it is important to make them as easy to use as possible. > Is everyone writing C++ code that depends on this behaviour? Absolutely. Changing it at this point would break essentially every non-trivial C++ program ever written. -- --Andrew Koenig ark@europa.att.com