Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!kddlab!icot32!nttlab!gama!etlcom!titcca!sragwa!wsgw!socslgw!diamond!diamond From: diamond@diamond.csl.sony.junet (Norman Diamond) Newsgroups: comp.lang.c++ Subject: Re: Any interest in making C++ a real superset of ANSI C? Message-ID: <10308@socslgw.csl.sony.JUNET> Date: 31 May 89 03:15:26 GMT References: <7435@hoptoad.uucp> <9395@alice.UUCP> Sender: news@csl.sony.JUNET Reply-To: diamond@csl.sony.junet (Norman Diamond) Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 32 In article <9395@alice.UUCP> ark@alice.UUCP (Andrew Koenig) writes: >Here's an example of why C++ does it the way it does. > class Complex { ... }; >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); Very true. This is why C almost copied the "typedef" construct from Pascal. "typedef" is very important. Good C programmers use it and good C++ programmers would use it for an example like this. typedef class Complex Complex; class Complex { ... }; A minor pain for new code, just as in C, and no pain for its users. >> 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. Yes, just as C++ breaks every non-trival C program ever written. C++ should be fixed. -- Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.co.jp@relay.cs.net) The above opinions are my own. | Why are programmers criticized for If they're also your opinions, | re-implementing the wheel, when car you're infringing my copyright. | manufacturers are praised for it?