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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8963682ce4cab241 X-Google-Attributes: gid103376,public From: wanker@exploited.barmy.army Subject: Re: GNAT Limitations? Date: 1998/01/25 Message-ID: <6afuas$vrn$1@Masala.CC.UH.EDU>#1/1 X-Deja-AN: 319147921 References: <6aesm3$sr6$1@Masala.CC.UH.EDU> <885721317.973387@wagasa.cts.com> Organization: The Exploited Barmy Army Newsgroups: comp.lang.ada Originator: punkrock@pegasus Date: 1998-01-25T00:00:00+00:00 List-Id: In article <885721317.973387@wagasa.cts.com>, Keith Thompson wrote: >wanker@exploited.barmy.army wrote: [Snip -- about not being able to omit record fields with default values during aggregate initilization] >It sounds like the "C/C++ to Ada" guide is either wrong or unclear. In a >subprogram call (which has similar syntax), you can omit some parameters >if they have default values. You can't do the same for record aggregates. >(Being able to omit components with default initial values would be a >nice feature, by the way.) It's wrong then because in the section on records it specifically states that you could do this. I could post the precise example of what it claims if anyone is interested, but it's probably pointless - thanks. >> 2) When I try to instantiate Ada.Unchecked_Deallocation, >> GNAT claims that Unchecked_Deallocation is not >> in Ada, which contradicts what's in the Language >> Referenec Manual and the "C/C++ to Ada Guide". >> Again, what gives? > >Another poster incorrectly suggested removing "Ada." prefix; that >shouldn't make any difference. Do you have a "with" clause for >Ada.Unchecked_Deallocation? Are you sure you spelled it correctly? >Does the following compile? Hmmmm, guess the poster should have heeded his own advice and read the manual ;). [Snip] >If not, you may have a misconfigured library; post the exact error >message the compiler gives you. > I compiled a slightly different sample, but using the info you provided and it worked beautifully, thank you. >> for I in Matrix(1)'Range loop >> for J in Matrix(2)'Range loop >> Some_Op (Matrix (I, J)); >> end loop; >> end loop; >> >> The compiler complains about using an attribute >> and indexing Matrix at the same time. > >If Matrix is a constrained 2d array type, you can use the 'Range >attribute on each of its dimensions, but your syntax is slightly off. >The range of the first dimension is Matrix'Range(1); the range of the >second dimension is Matrix'Range(2). Right that was another error in the C/C++ to Ada transition guide. I tried it this way and again it works perfectly. Thanks to both of you. > >If Matrix is an unconstrained type (which is more likely), you'll need to >replace Matrix by the name of an object of type Matrix. It's probably >clearer to do this even if Matrix is constrained. And, of course, >you'll need to make the same change in Matrix (I, J). Right, that's what I did. > >-- >Keith Thompson (The_Other_Keith) kst@cts.com <*> >^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H >San Diego, California, USA >Trying to keep my daily caffeine intake between the RDA and the LD50.