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: 103376,e55245590c829bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!u10g2000yqk.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Mon, 1 Nov 2010 11:12:04 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1288635125 21294 127.0.0.1 (1 Nov 2010 18:12:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 1 Nov 2010 18:12:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u10g2000yqk.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:16086 Date: 2010-11-01T11:12:04-07:00 List-Id: On Nov 1, 10:16=A0am, Yannick Duch=EAne (Hibou57) wrote: > Le Mon, 01 Nov 2010 12:50:50 +0100, (see below) =A0 > a =E9crit:>> Children always have visibility= into the specs of their ancestors, so =A0 > >> you > >> never need to "with" said ancestors. > > > While the first claim is true, the second does not follow, as I am give= n =A0 > > to > > understand it. > > > If you need: > > > =A0 pragma Elaborate_All(); > > > Then you also need: > > > =A0 with ; > > I've just checked it with GNAT, it did not return an error. i= s =A0 > implicitly withed even with Elaborate_All. No special case with this =A0 > pragma. Then this version of GNAT is wrong. The visibility rules for context clauses (the WITH and USE clauses and pragmas appearing before the top-level PACKAGE, PROCEDURE, FUNCTION, etc.) are different from the normal visibility rules. See 10.1.6 and especially paragraph 3. Jeff was correct except with respect to context clauses (an easy thing to forget). Please don't rely on GNAT, or any other compiler, to determine whether something is legal Ada or not. None of them is perfect at getting the language rules correct. -- Adam