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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ad030c25af062445 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!l17g2000yqe.googlegroups.com!not-for-mail From: tolkamp Newsgroups: comp.lang.ada Subject: Re: How to include vector operators? Date: Tue, 7 Dec 2010 03:11:17 -0800 (PST) Organization: http://groups.google.com Message-ID: <294277bf-c947-40e4-86ec-3071e33b5adb@l17g2000yqe.googlegroups.com> References: <1ba74849-bafa-499f-a448-661dff1f60bd@c39g2000yqi.googlegroups.com> <838d2332-d88f-4010-ab8f-e56ca23a35b1@j18g2000prn.googlegroups.com> NNTP-Posting-Host: 77.248.181.38 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1291720277 5451 127.0.0.1 (7 Dec 2010 11:11:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Dec 2010 11:11:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l17g2000yqe.googlegroups.com; posting-host=77.248.181.38; posting-account=nZAcngoAAACcfYM9wDw3w9Z1XR3bObfs User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.1; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:16807 Date: 2010-12-07T03:11:17-08:00 List-Id: On 6 dec, 22:37, Adam Beneschan wrote: > On Dec 6, 1:03=A0pm, tolkamp wrote: > > > > > > > In my application the package Ada.Numerics.Generic_Real_Arrays =A0is > > included. > > > Code: > > > with Ada.Numerics.Generic_Real_Arrays; > > package Vectors is new Ada.Numerics.Generic_Real_Arrays(Float); > > > How to include the vector operators like "+" and "-" ? > > > I tried the follwing: > > function "+" (Left, Right : Vectors.Real_Vector) return > > Vectors.Real_Vector > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0renames > > Ada.Numerics.Generic_Real_Arrays.Instantiations."+"; > > > However this gives the error: > > invalid prefix in selected component "Generic_Real_Arrays". > > function "+" (Left, Right : Vectors.Real_Vector) return > Vectors.Real_Vector > =A0 =A0renames Vectors."+"; > > But you probably really want to use this, which will make all the > operators visible: > > =A0 =A0use type Vectors.Real_Vector; > > (and maybe the same for Real_Matrix). > > But NOT this: > > =A0 =A0use type Ada.Numerics.Generic_Real_Arrays.Real_Vector; > > You can't access declarations in a generic package directly. =A0You have > to access the declarations in a generic *instance*. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- Adam- = Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - Thank you for your solution. Now it works correct. Fred