Re: Default rep specs for record types - documented??



In article <meKdnXXIJd6tVPfeRVn-vw@xxxxxxxxxxx>, Steve wrote:
>
> Look in the Ada 95 LRM section 13, Representation Issues
>
> Section 13.1 paragraph 19
>
> If an aspect of representation of an entity is not specified, it is
> chosen by default in an unspecified manner.
>
> So... if it matters, use a representation clause.

Thanks for the feedback. Essentially what that is saying is that
there are no guarantees for what to expect from a default
representation. It bothers me to read this, because it counters my
understanding - and counters what Cohen has written in ADA as a Second
Language.

Example: Cohen states that enumerated types are guaranteed to have a
representation that numbers the first element as zero, and increases
sequentially. Is this not really guaranteed?

What's disappointing is that rep specs add considerable clutter.
Readable code avoids redundancy, so having default representation
aspects that are guaranteed enable less noisey code. I'm not looking
forward to rep specing records bit for bit simply to enforce the same
order of elements that's specified in the operation specs.
.



Relevant Pages

  • Re: Ada decimal types
    ... The representation of the multiples of small can be anything that the ... It is possible for a compiler to reject specifying a small of 1.0e-6. ... Ada 83 compilers used to reject these because ...
    (comp.lang.ada)
  • Re: ANN: ASIS2XML 20041024a
    ... >> this is the Right Thing for an XML representation). ... All important UML tool can import XMI. ... higher than that of an Ada program. ...
    (comp.lang.ada)
  • Re: Enumeration representation enhancement proposal
    ... representation has no impact on comparison. ... Is not correct Ada. ... that of the original declaration of the enumeration. ... the order rule for enumeration representations. ...
    (comp.lang.ada)
  • Re: Avatox 1.0: Trouble with encoding in Windows
    ... representation (which is not defined by Ada anyway) is probably broken. ... Wide_Wide_String are defined in terms of Unicode. ... returning it in a particular Unicode encoding. ...
    (comp.lang.ada)
  • Re: Ada decimal types
    ... The representation of the multiples of small can be anything that the ... It is possible for a compiler to reject specifying a small of 1.0e-6. ... Ada 83 compilers used to reject these because ...
    (comp.lang.ada)