Path: utzoo!attcan!uunet!zephyr.ens.tek.com!tekcrl!brucec From: brucec@phoebus.phoebus.labs.tek.com (Bruce Cohen;;50-662;LP=A;) Newsgroups: comp.std.c++ Subject: Re: Inheritance in cfront and g++ Message-ID: Date: 20 Aug 90 18:08:19 GMT References: <1990Aug17.141710.5004@aucs.uucp> <38219@ucbvax.BERKELEY.EDU> <1990Aug20.115115.3646@tukki.jyu.fi> Sender: news@tekcrl.LABS.TEK.COM Distribution: comp Organization: Tektronix Inc. Lines: 37 In-reply-to: sakkinen@tukki.jyu.fi's message of 20 Aug 90 11:51:15 GMT In article <1990Aug20.115115.3646@tukki.jyu.fi> sakkinen@tukki.jyu.fi (Markku Sakkinen) writes: > ... > > I.e. a function declaration in an inner scope hides all functions > with the same name declared in outer scopes, independently of > argument types. According to the Release 2.0 Ref.Man., Sc. 13.1, > this applies even to other cases than base class - derived class. > > ... > > This is an unorthogonal kludge, which makes the rules > of a complicated language even more complicated. > As far as I can see, it is also a deviation from older language > specifications. Already the subtle difference between virtual > and non-virtual overloading can be surprising enough; we don't > need this hiding rule to bite us. I agree that it's a kludge, and a dangererous one at that. Name hiding is one of the easiest ways to inadvertantly leave landmines in your code. Granted that someone will get it wrong no matter which way you standardize it, the best way is to remove complexity wherever possible, to make it easier for programmers to predict what will happen. > If there are enough special cases to warrant this kind of behaviour, > it should be declared with a new keyword, say "semipublic" Can anyone give me a case where the *programmer*, as opposed to the overprotective language designer, wants / needs this capability? Is there a case which can't be more cleanly handled with a disciplined use of scoping of a base class' members and controlled scoping of inheritance? -- --------------------------------------------------------------------------- NOTE: USE THIS ADDRESS TO REPLY, REPLY-TO IN HEADER MAY BE BROKEN! Bruce Cohen, Computer Research Lab email: brucec@tekcrl.labs.tek.com Tektronix Laboratories, Tektronix, Inc. phone: (503)627-5241 M/S 50-662, P.O. Box 500, Beaverton, OR 97077