comp.lang.ada
 help / color / mirror / Atom feed
From: NCOHEN@IBM.COM ("Norman H. Cohen")
Subject: Question about Ada renaming...
Date: 20 Mar 91 14:04:24 GMT	[thread overview]
Message-ID: <9103201431.AA27295@ajpo.sei.cmu.edu> (raw)

Fred Stluka asked whether the type marks A.INT and AAA.INT, where A is a
renaming of package AAA, should be considered to conform.  According to
Ada 83 rules, they should not.  RM paragraphs 6.3.1(5,6) state:

    5  Two subprogram specifications are said to _conform_ if,
       apart from comments and the above allowed variations, both
       specifications are formed by the same sequence of lexical
       elements, and corresponding lexical elements are given the
       same meaning by the visibility and overloading rules.

    6  Conformance is likewise defined for formal parts, discriminant
       parts, and type marks (for deferred constants and for actual
       parameters that have the form of a type conversion (see 6.4.1)).

Paragraph 6 states that conformance of type marks is given by the same
rules as conformance of subprogram specifications, namely those in
paragraph 5.  Paragraph 5 requires identical sequences of lexical
elements (which "A.INT" and "AAA.INT" clearly are not) except for the
"above allowed variations" described in paragraphs 2-4.  These variations
allow numeric literals to conform to differently written but equivalent
numeric literals (e.g. 40960, 40_960, 4096E1, 16#A000#, 16#A#E3),
expanded names to conform to corresponding simple names (e.g. INT and
A.INT), and operator symbols to conform to differently capitalized
operator symbols (e.g. "AND", "And", and "and").  They do not allow a
name to conform to another name, declared by a renaming declaration to
denote the same entity.

Conformance is not transitive:  Though A.INT conforms to INT and INT
conforms to AAA.INT, A.INT does not conform to AAA.INT.

             reply	other threads:[~1991-03-20 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-03-20 14:04 "Norman H. Cohen" [this message]
1991-03-21 16:14 ` Question about Ada renaming Fred Stluka
  -- strict thread matches above, loose matches on Subject: below --
1991-03-18 18:53 Fred Stluka
replies disabled

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