🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #385

Re: Inheritance in cfront and g++

#385
From: Bruce Cohen;;50-662;LP=A;
Date: Mon, 20 Aug 1990 18:08
37 lines
2482 bytes
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
Technical Details
Message-ID: <BRUCEC.90Aug20110819@phoebus.phoebus.labs.tek.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!tekcrl!brucec
References: <FOX.90Aug15101045@devo.allegra.att.com> <1990Aug17.141710.5004@aucs.uucp> <38219@ucbvax.BERKELEY.EDU> <1990Aug20.115115.3646@tukki.jyu.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <BRUCEC.90Aug20110819@phoebus.phoebus.labs.tek.com>
Date: 20 Aug 90 18:08:19 GMT
References: <FOX.90Aug15101045@devo.allegra.att.com> <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