From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,94d84e4971c0caee X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Inheritance with Ada types Date: Tue, 09 Feb 2010 12:23:39 +0100 Organization: Adalog Message-ID: References: <92c90b37-0e9b-49f4-ab37-fbd256ed6f06@k41g2000yqm.googlegroups.com> <1d6a685b-c07d-42fa-b8f4-02c74ac70169@u26g2000yqm.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1265716486 790 195.25.228.57 (9 Feb 2010 11:54:46 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 9 Feb 2010 11:54:46 +0000 (UTC) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <1d6a685b-c07d-42fa-b8f4-02c74ac70169@u26g2000yqm.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:9028 Date: 2010-02-09T12:23:39+01:00 List-Id: Hibou57 (Yannick Duch�ne) a �crit : > On 9 f�v, 10:11, Jean-Pierre Rosen wrote: >>> clause... the use clause is particularly evil here. > With package named Parent, containing a type named Parent, having a > use clause on Parent brings into a context where the name Package can > be both resolved as a package or as a type. > > The use clause is clearly involved here, as one the way to get ride of > this error is to remove the use clause. The other way being to rename > either the type either the package. > > May be I was wrong to say the use clause is particularly evil there : > I should have said � the use clause is particularly vicious there > � (due to its vicious side effect in such a kind of context). > I don't see anything vicious. You have to understand that the use clause is "weak", it never goes against normal visibility. You have a package named Parent which is directly visible, a type named Parent which is use-visible. In this case, the use clause politely gives the way to direct visibility. The evil/vicious/whatever is in having nested entities with the same name. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr