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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e977cd3ab4e49fef X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Question about record rep spec placement Date: 1997/01/18 Message-ID: #1/1 X-Deja-AN: 210678279 references: <32DF9F55.7EA3@lmtas.lmco.com> <5bof0o$q0i@zeus.orl.mmc.com> <32E02DB1.6E06@lmtas.lmco.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1997-01-18T00:00:00+00:00 List-Id: In article <32E02DB1.6E06@lmtas.lmco.com>, Ken Garlington wrote: >I guess this depends upon whether being unable to put the rep spec in >the private area due to freezing rules is a "pathological" case (as has >been described previously) or will occur relatively often. If the >former, >then a comment should do for those cases where the rep spec can't be >placed in the private area. If the latter, then I think this potential >incompatibility from Ada83 to Ada should be more widely advertised. I think you misunderstood what somebody said about "pathological". The upward incompatibilities are pathological, I believe. However, there are violations of the freezing rules that are not pathological, but these are not upward incompatibilities, since they existed in Ada 83. By and large, the Ada 95 rules are *more* permissive than the Ada 83 rules. Here's a violation: package P is type Point is record X, Y: Integer; end record; Origin: constant Point := (0, 0); private for Point use -- Illegal. record ... end record; end P; The above is illegal in both Ada 83 and Ada 95. But declaring a constant is a perfectly reasonable thing to do. Another example is passing a type to a generic instantiation -- perfectly reasonable, and prevents later rep clauses. Here's an example of an upward incompatility: package P is type R is record X: Integer; end record; task T is pragma Priority(X'Size); end T; private for R'Size use 32; -- Illegal in Ada 95. end P; The above is legal in Ada 83, and the pragma is IGNORED! This seems pretty pathological to me. Here's an example where the rules are more permissive: package P is type T is private; generic X: T; -- Illegal in Ada 83, now legal in Ada 95. package G is ... end G; private type T is ...; end P; The above seems like a pretty reasonable thing to do. >I don't know which is the case; does anyone has real-world experience >they >could share? It's happened to me more than once. But it doesn't happen a LOT. - Bob