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,FREEMAIL_FROM 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,UTF8 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Mon, 01 Nov 2010 00:27:44 +0100 Organization: Ada @ Home Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> NNTP-Posting-Host: Q7c1it4KCXejPeBjt1XFRw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.63 (Win32) Xref: g2news2.google.com comp.lang.ada:16049 Date: 2010-11-01T00:27:44+01:00 List-Id: Le Sun, 31 Oct 2010 23:36:29 +0100, Vinzent Hoefler = a =C3=A9crit: >> procedure Test_Game is >> C : Character; > > Try "C : Games.RPG.Dnd.Character" here. > >> begin >> C.Abilities(Str) :=3D (Score =3D> 10, Modifier =3D> -1); >> Put (C.Abilities(Str).Score); >> put (C.Abilities(Str).Modifier); >> end Test_Game; > > I suspect you're clashing with the predefined "Character" type here. This recall me a similar thing I get a little long time ago. I wanted to= = define a String type which I expected to hide the one of Standard, but = always failed. I asked about it on a forum after I've checked the = reference manual that time. I was thinking visibility rules was so that = I = was allowed to hide something from Standard, did not found anything = stating the opposite, and finally never get an answer to this old questi= on. I suppose the compiler here is GNAT, like near to every time, but would = be = nice to confirm. Would be interesting to know if this is GNAT specific o= r = not (or else if indeed the reference manual has something saying one = cannot hide a declaration of package Standard). Would be an answer to an old question. Another variant to test also : procedure Test_Game is subtype Character is Games.RPG.Dnd.Character; C : Character; ... -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens.