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,16e06ab8237bab07 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.72.42 with SMTP id a10mr1529544pav.34.1350786757168; Sat, 20 Oct 2012 19:32:37 -0700 (PDT) Received: by 10.68.190.35 with SMTP id gn3mr1658194pbc.13.1350786757150; Sat, 20 Oct 2012 19:32:37 -0700 (PDT) Path: s9ni21683pbb.0!nntp.google.com!kt20no5896584pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 20 Oct 2012 19:32:36 -0700 (PDT) In-Reply-To: <87wqykd1wv.fsf@ludovic-brenta.org> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=118.209.197.202; posting-account=l8GBMwoAAADCbqdOJSbg4dBRqkD14dJd NNTP-Posting-Host: 118.209.197.202 References: <8391f2d1-b4c7-4b12-bc16-1419a1aa9739@googlegroups.com> <87wqykd1wv.fsf@ludovic-brenta.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0360d84c-ef42-4107-b837-4063da273ad8@googlegroups.com> Subject: Re: Is this a bug in Ada.Numerics? From: Leo Brewin Injection-Date: Sun, 21 Oct 2012 02:32:37 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-10-20T19:32:36-07:00 List-Id: Hi Ludovic, Thanks for the quick and detailed response. Your suggestion (3) and (4) cer= tainly do fix the problem but I was posing the original code (in its less t= han ideal form) as a way to understand how the compiler sorts out these sco= ping/visibility issues. In my real code I would do as you suggest. But having digested your answer I'm still a bit confused (sorry). Here is t= he "procedure" version of the above package, with Ada.Numerics.Generic_Complex_Types; with Ada.Numerics.Generic_Complex_Elementary_Functions; procedure foo is type Real is digits 18; =09 package Complex_Types is new=20 Ada.Numerics.Generic_Complex_Types (Real); use foo.Complex_Types; subtype Complex is foo.Complex_Types.Complex; =20 procedure bar (z : in out Complex); =20 package Complex_Maths is new=20 Ada.Numerics.Generic_Complex_Elementary_Functions (Complex_Types); =20 procedure bar (z : in out Complex) is begin z :=3D Complex'(Re(z),0.0); end bar; begin null; end foo; This does compile and yet (by my reading of your reply) the "use foo" and "= subtype complex" lines should introduce two distinct versions of Complex an= d thus should produce a compiler error. I'm sure I've got this wrong, my apologies for wasting your time... Cheers, Leo