Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!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: <10302@socslgw.csl.sony.JUNET> Date: 30 May 89 11:32:10 GMT References: <7435@hoptoad.uucp> <1997@dataio.Data-IO.COM> 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 <1997@dataio.Data-IO.COM> bright@dataio.Data-IO.COM (Walter Bright) writes: >There's an even easier solution. I've proposed it to Bjarne, but he >disliked it on the grounds that it would require some reediting of >existing C++ code. >The solution is to retain the separate tag name space for structs and >unions, but use the regular name space for class names. Thus, if you >declare a struct as 'struct A', you always have to use 'struct A' when >referring to A. If you declare it as 'class A', then the typedef is >created. Bjarne's stated reason for disliking this solution is in fact a strong reason for liking this solution. There is a lot more existing C code to be "inherited" than there is existing C++ code. Mind you, code that played games with structure tags (taking advantage of the separate name space) is ugly and maybe doesn't deserve such efforts, but in other contexts, Bjarne said that it was a high priority to maintain compatibility with existing ugliness. Walter Bright's suggestion suits the style of C and C++ very closely, and meets that high priority requirement much better than the present solution. It might be slightly more consistent not to even create the typedef for classes, and let the class writer also write the typedef. -- 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?