comp.lang.ada
 help / color / mirror / Atom feed
From: Anonymous Coward <bogus_addy@bogus_domain.net>
Subject: Re: Default rep specs for record types - documented??
Date: Sun, 06 Nov 2005 16:08:13 GMT
Date: 2005-11-06T16:08:13+00:00	[thread overview]
Message-ID: <slrndmshkt.6kb.bogus_addy@tango.mindfuq.org> (raw)
In-Reply-To: Qs6dndQOsuQXkPPeRVn-qw@comcast.com

In article <Qs6dndQOsuQXkPPeRVn-qw@comcast.com>, Steve wrote:
> "Jeffrey R. Carter" <spam@spam.com> wrote in message 
> news:YNWaf.50$Xo.35@newsread2.news.pas.earthlink.net...
>> Steve wrote:
>>>
>>> I disagree with this conclusion.  While I agree that 3.5.1 describes the 
>>> relation between the representation values, it does not define the 
>>> representation.
>>
>> ARM 3.5.1 defines the position numbers, and ARM 13.4 specifies that the 
>> representation will be the same as the position numbers unless specified 
>> otherwise.
>>
> 
> Yes, what is the representation of a "position number"?
> 
> Is a position number 8 bits?  16 bits? 32 bits?

You guys are arguing semantics at this point.  There are multiple
*aspects* of a representation specification.  In the case of
enumerations, there are four aspects that define the representation:

  mapping of codes to tags
  object size
  value size
  alignment

Jeff was talking about the mapping, and you're talking about the size.
The mapping has a default rep spec guaranteed by the ARM, while the
object size does not have a default rep spec.

> Isn't it true that for the definition:
> 
>   type Color is ( Red, Green, Blue );
> 
> Compiler A may choose to use 8 bits to represent an instance of Color, while 
> compiler B may use 32 bits to represent an instance of color?
> 
> But if you add a representation clause:
> 
>   for Color'size use 8;
> 
> All compilers will use the same number of bits to represent an instance of 
> color?

That is true.  However, it would be silly to provide a complete rep
spec, and write:

  for Color use (Red => 0, Green => 1, Blue => 2); --redundant
  for Color'size use 8;                            --interesting
  for Color'alignment use 1;                       --not sure on this

because the mapping rep clause would be redundant noise.  It's
fortunate that the ARM provides default rep specs for some aspects of
representation so we can be concise without giving up precision.



  reply	other threads:[~2005-11-06 16:08 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04  2:21 Default rep specs for record types - documented?? Anonymous Coward
2005-11-04  2:36 ` Steve
2005-11-04  4:11   ` Anonymous Coward
2005-11-04  5:30     ` Jeffrey R. Carter
2005-11-05  3:13       ` Steve
2005-11-05  4:45         ` Jeffrey R. Carter
2005-11-06 14:05           ` Steve
2005-11-06 16:08             ` Anonymous Coward [this message]
2005-11-07  7:25             ` Jeffrey R. Carter
2005-11-08 13:36               ` Steve
2005-11-14  1:12             ` Robert A Duff
2005-11-14  3:03               ` Anonymous Coward
2005-11-14 18:08                 ` Jeffrey R. Carter
2005-11-14 18:49                 ` Robert A Duff
2005-11-15  1:16                   ` ADA compilers can reject types arbitrarily? Anonymous Coward
2005-11-15  2:10                     ` tmoran
2005-11-15  3:12                     ` Robert A Duff
2005-11-15  6:44                     ` Simon Wright
2005-11-16  0:16                       ` Adaists Deny Acronym. (was: ADA compilers can reject types arbitrarily?) Björn Persson
2005-11-16  5:38                         ` Adaists Deny Acronym Simon Wright
2005-11-16  6:16                         ` Adaists Deny Acronym. (was: ADA compilers can reject types arbitrarily?) Samuel Tardieu
2005-11-15 12:43                     ` ADA compilers can reject types arbitrarily? Jeff Creem
2005-11-14 21:14                 ` Default rep specs for record types - documented?? Simon Wright
2005-11-04 13:26     ` Stephen Leake
2005-11-04 14:33       ` Marc A. Criley
2005-11-04 18:35         ` Georg Bauhaus
2005-11-04 20:07           ` Britt Snodgrass
2005-11-04 14:39       ` Stephen Leake
2005-11-04 15:27         ` Britt Snodgrass
2005-11-04 15:55           ` Lauri Ora
2005-11-04 21:42             ` Larry Kilgallen
2005-11-05  2:26             ` Anonymous Coward
2005-11-05  2:42               ` Frank J. Lhota
2005-11-05  3:27               ` Ed Falis
2005-11-05  3:55                 ` Anonymous Coward
2005-11-05  4:07                 ` Lauri Ora
2005-11-05 13:46                   ` Ed Falis
2005-11-05 10:14                 ` Stephen Leake
2005-11-04 16:52         ` Frank J. Lhota
2005-11-04 16:57           ` Frank J. Lhota
2005-11-04 23:27           ` tmoran
2005-11-05 10:25           ` Stephen Leake
2005-11-14  1:09             ` Robert A Duff
2005-11-05  3:33       ` Anonymous Coward
2005-11-05 10:34         ` Stephen Leake
2005-11-05 16:35           ` ADA/C interfaces: type representations uncontrollable in C Anonymous Coward
2005-11-05 16:49             ` Ed Falis
2005-11-05 18:24             ` tmoran
2005-11-09  2:12           ` 'Size can mean value size OR object size, depending Anonymous Coward
2005-11-09  3:27             ` Jeffrey R. Carter
2005-11-09  4:04               ` Anonymous Coward
2005-11-05 14:27         ` Default rep specs for record types - documented?? Michael Bode
2005-11-05 16:17           ` pragma convention Anonymous Coward
2005-11-06  1:07             ` Jeffrey R. Carter
2005-11-06 22:22               ` Anonymous Coward
2005-11-07  7:34                 ` Jeffrey R. Carter
2005-11-05 14:39         ` Default rep specs for record types - documented?? Martin Krischik
2005-11-04  9:40   ` Martin Dowie
2005-11-04 14:36   ` Marc A. Criley
2005-11-04 17:45 ` Martin Krischik
replies disabled

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