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,5c1125c290d9dd14 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ANN: Ada 2005 Math Extensions, 20100810 release Date: Sat, 14 Aug 2010 17:26:20 +0100 Organization: A noiseless patient Spider Message-ID: References: <82ocd8m826.fsf@stephe-leake.org> <82sk2ivwa7.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sat, 14 Aug 2010 16:26:22 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="18840"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IU8QJ8cV+ZDny/xzUFk4Ay+oKV/ZKdko=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:ri2LmVFZ862zdaMuaKvuOqYtMAc= sha1:SKHCVZzHNyFSPPPGyHbosI1wGHQ= Xref: g2news1.google.com comp.lang.ada:13289 Date: 2010-08-14T17:26:20+01:00 List-Id: Stephen Leake writes: > sjw writes: >> generic >> with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real); >> with package Complex_Arrays is new Ada.Numerics.Generic_Complex_Arrays >> (Generic_Real_Arrays, Complex_Types); > > I see the problem. Generic_Real_Arrays is the name of the parent generic > package; that's not a concrete package, so it can't be used here. Exactly so. > This compiles: > > with Ada.Numerics.Generic_Complex_Arrays; > with Ada.Numerics.Generic_Complex_Types; > with Ada.Numerics.Generic_Real_Arrays; > generic > type Real is digits <>; > with package Real_Arrays is new Ada.Numerics.Generic_Real_Arrays (Real); > with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real); > with package Complex_Arrays is new Ada.Numerics.Generic_Complex_Arrays (Real_Arrays, Complex_Types); > package Extensions is > > function Eigenvalues (A : Real_Arrays.Real_Matrix) return Complex_Arrays.Complex_Vector; > > end Extensions; > > Is there some reason you want Extensions to be a child of > Generic_Real_Arrays? Umm. In the past, I've often introduced "extensions' in child (generic) packages, usually because the extension needed visibility of the private part of the original. That's not so in this case, as it happens, but I find the idiom comfortable. Given that, the function taking Complex_Matrix and returning Complex_Vector has "obviously" to be in a child of Generic_Complex_Arrays. So I thought that the function taking Real_Matrix should be in a child of Generic_Real_Arrays, in spite of the fact it returns a Complex_Vector. Clearly this is not the way Nature intended!