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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fd173879a595bde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!atl-c05.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc06.POSTED!20ae255c!not-for-mail Newsgroups: comp.lang.ada From: Anonymous Coward Subject: Re: Default rep specs for record types - documented?? References: Message-Id: User-Agent: slrn/0.9.7.4 (Linux) Date: Sun, 06 Nov 2005 16:08:13 GMT NNTP-Posting-Host: 141.149.78.234 X-Complaints-To: abuse@verizon.net X-Trace: trnddc06 1131293293 141.149.78.234 (Sun, 06 Nov 2005 11:08:13 EST) NNTP-Posting-Date: Sun, 06 Nov 2005 11:08:13 EST Xref: g2news1.google.com comp.lang.ada:6255 Date: 2005-11-06T16:08:13+00:00 List-Id: In article , Steve wrote: > "Jeffrey R. Carter" 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.