comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Boolean Representation
Date: 1998/09/25
Date: 1998-09-25T00:00:00+00:00	[thread overview]
Message-ID: <6uend9$fl8$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 360A8CCB.2D358953@hso.link.com

In article <360A8CCB.2D358953@hso.link.com>,
  "Samuel T. Harris" <sam_harris@hso.link.com> wrote:
> However, I have had occasion to be concerned with the
> actual internal representation. This is where enumeration
> representation clauses come in handy. Specifically, I have
> had to represent a memory-mapped device with an Ada record.
> One of the fields was a 16-bit flag array. A packed array
> of booleans fit nicely. However, to insure the boolean
> literals FALSE and TRUE have the appropriate internal
> numbers, I used a derived type of boolean to which I applied
> the appropriate representation clause. I know that this
> might sound a bit paranoid but I tend to favor ultra-correctness
> over any reliance on common compiler implementations.


There is a difference between relying on common compiler
implementations, and relying on the RM.

In fact the above described technique is significantly
non-portable because of 13.4(10)

   10  An implementation should support at least the
       internal codes in the range System.Min_Int..
       System.Max_Int.  An implementation need
       not support enumeration_representation_clauses
       for boolean types.

On the other hand, obviously if a boolean is stored in one
bit, False must be zero and True must be one, because
absolute ordering is required.

Your paranoia here is leading you astray into completely
unnecessary and significantly implementation dependent
coding!

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  reply	other threads:[~1998-09-25  0:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-24  0:00 Boolean Representation matthew_snyder
1998-09-24  0:00 ` dewarr
1998-09-24  0:00   ` Samuel T. Harris
1998-09-25  0:00     ` dewarr [this message]
1998-09-27  0:00       ` Samuel T. Harris
1998-09-28  0:00         ` dewar
1998-09-24  0:00   ` matthew_snyder
1998-09-24  0:00     ` Tom Moran
1998-09-25  0:00       ` dewarr
1998-09-25  0:00         ` Tom Moran
1998-09-24  0:00     ` dennison
1998-09-25  0:00     ` Robert I. Eachus
1998-09-25  0:00     ` dewarr
1998-09-24  0:00 ` dennison
1998-09-24  0:00   ` Keith Thompson
1998-09-25  0:00     ` dennison
1998-09-25  0:00       ` Keith Thompson
1998-09-26  0:00         ` Tucker Taft
1998-09-26  0:00           ` Keith Thompson
1998-09-27  0:00             ` null pointer representation (was: Boolean Representation) Arthur Evans Jr
1998-09-27  0:00               ` Keith Thompson
1998-09-28  0:00               ` dewarr
1998-09-28  0:00                 ` Lieven Marchand
1998-09-28  0:00                 ` Keith Thompson
1998-09-28  0:00                   ` dewarr
1998-09-30  0:00                     ` Keith Thompson
1998-10-02  0:00                       ` Robert I. Eachus
1998-09-27  0:00             ` Boolean Representation dewarr
1998-09-27  0:00           ` dewarr
  -- strict thread matches above, loose matches on Subject: below --
1998-09-24  0:00 matthew_snyder
1998-09-25  0:00 ` Tucker Taft
1998-09-25  0:00   ` dewarr
1998-09-25  0:00   ` dewarr
replies disabled

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