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, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,227757d168eaa8a5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!feed.news.tiscali.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: A question re meaning/use of the "for ... use ..." Date: Sun, 05 Dec 2004 16:47:39 +0100 Organization: None Message-ID: <18377261.cty3m9OIig@linux1.krischik.com> References: <41b3291e$0$44072$5fc3050@dreader2.news.tiscali.nl> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1102262390 01 8881 mUeMXz36f7XnsP+ 041205 15:59:50 X-Complaints-To: usenet-abuse@t-online.de X-ID: GtjwzEZGwed7yfxv5zzbpwZMwoFBZgUNjS--vpOMSq+mWUKZbJJA8S User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6776 Date: 2004-12-05T16:47:39+01:00 List-Id: Erik J Pessers wrote: > 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 That is what I would like as well. However the 'Pos( Attribute is defined differently by the standard. > 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? AFAIK the representation clause sets the internal representation which you can access with Unchecked_Convertion or which is used for writing to files and 'Pos will allways return the position regardless of internal representation. One of the very very few designs in Ada which I find stupid. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com