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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:4105:: with SMTP id x5mr1732704ita.33.1548245313385; Wed, 23 Jan 2019 04:08:33 -0800 (PST) X-Received: by 2002:a9d:148:: with SMTP id 66mr45322otu.5.1548245313247; Wed, 23 Jan 2019 04:08:33 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!q69no837524itb.0!news-out.google.com!v71ni962ita.0!nntp.google.com!q69no837523itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 23 Jan 2019 04:08:32 -0800 (PST) In-Reply-To: <72fd7f46-21bb-45b9-9621-237bca776378@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.126.240.2; posting-account=Rb9AYAoAAACJxfG9wutXlaLWNAfJy4_j NNTP-Posting-Host: 94.126.240.2 References: <3d782720-227d-4d86-b403-eacbd1b9d0d2@googlegroups.com> <72fd7f46-21bb-45b9-9621-237bca776378@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <217206e7-81aa-4aa8-8d19-66498c36100d@googlegroups.com> Subject: Re: Problem with Position of the enumeration Type From: Luis Ladron de Guevara Moreno Injection-Date: Wed, 23 Jan 2019 12:08:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:55335 Date: 2019-01-23T04:08:32-08:00 List-Id: El mi=C3=A9rcoles, 23 de enero de 2019, 11:33:36 (UTC+1), AdaMagica escrib= i=C3=B3: > See RM 13.4(11/3)ff: > NOTES > 14 Unchecked_Conversion may be used to query the internal codes used for > an enumeration type. The attributes of the type, such as Succ, Pred, and = Pos, are unaffected by the enumeration_representation_clauserepresentation_= clause. >=20 > Some questions on your code: >=20 > Position : Integer; -- Why is this Integer and not Natural? > =20 > for I in E_Test'Base loop -- Why do you use 'Base here? I wrote a Integer as an example, i could add Natural also, for this example= there are not difference. I'm using 'Range to go through all the positions in enumeration. I tried to use Ada.Unchecked_Conversion and i got obtain the values for the= position. but as you told me, if i use 'post (), the number of the list st= art in 0.