comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: A question re meaning/use of the "for ... use ..."
Date: Sun, 05 Dec 2004 16:47:39 +0100
Date: 2004-12-05T16:47:39+01:00	[thread overview]
Message-ID: <18377261.cty3m9OIig@linux1.krischik.com> (raw)
In-Reply-To: 41b3291e$0$44072$5fc3050@dreader2.news.tiscali.nl

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



  reply	other threads:[~2004-12-05 15:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-05 15:27 A question re meaning/use of the "for ... use ..." Erik J Pessers
2004-12-05 15:47 ` Martin Krischik [this message]
2004-12-05 15:59 ` Stephen Leake
2004-12-05 16:52   ` Jeffrey Carter
2004-12-06 19:59     ` Randy Brukardt
2004-12-07  1:36       ` Jeffrey Carter
2004-12-07  2:40         ` David C. Hoos, Sr.
2004-12-07 20:59         ` Randy Brukardt
2004-12-08  1:41           ` Jeffrey Carter
2004-12-08  8:40           ` Martin Dowie
2004-12-08 16:23             ` Georg Bauhaus
2004-12-08  3:18       ` Keith Thompson
2004-12-08 13:48         ` David C. Hoos
2004-12-08 19:50         ` Randy Brukardt
2004-12-08 23:00           ` Keith Thompson
2004-12-09 23:06             ` Randy Brukardt
2004-12-10  2:26               ` Keith Thompson
2004-12-10 19:42                 ` Randy Brukardt
2004-12-10 21:18                   ` Keith Thompson
2004-12-11  0:53                     ` Keith Thompson
2004-12-10  3:13             ` David C. Hoos
2004-12-10  9:23               ` Keith Thompson
2004-12-10 13:24                 ` David C. Hoos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox