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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,227757d168eaa8a5,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!transit.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!transit.news.xs4all.nl!195.241.76.212.MISMATCH!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Date: Sun, 05 Dec 2004 16:27:39 +0100 From: Erik J Pessers Reply-To: erik.pessers@ACM.ORG User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: A question re meaning/use of the "for ... use ..." X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <41b3291e$0$44072$5fc3050@dreader2.news.tiscali.nl> Organization: Tiscali bv NNTP-Posting-Date: 05 Dec 2004 16:28:31 CET NNTP-Posting-Host: 62.235.176.8 X-Trace: 1102260511 dreader2.news.tiscali.nl 44072 62.235.176.8:32787 X-Complaints-To: abuse@tiscali.nl Xref: g2news1.google.com comp.lang.ada:6775 Date: 2004-12-05T16:28:31+01:00 List-Id: Hi, A question re meaning/use of the "for ... use ..." construct. Given the code snippet at the bottom of this mail, I was sort of expecting to see an output reading like: Pos for AA : 0 Pos for BB : 2 Pos for CC : 3 Instead (when compiling with bot Gnat3.15p and Gnat-3.4.2-2), the actual code output reads: Pos for AA : 0 Pos for BB : 1 Pos for CC : 2 Anybody who can shed some light, and explain what will be going on behind the curtains? TIA, Erik Pessers === with Ada.Text_IO ; procedure t is type enm is (aa, bb, cc) ; for enm use (aa => 0, bb => 2, cc => 3); begin for i in enm'Range loop Ada.Text_IO.Put_Line ("Pos for " & enm'Image(i) & " :" & Integer'Image(enm'Pos(i))) ; end loop ; end t ;