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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,87fae37c03e8e6bf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-28 21:47:51 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!spool.mu.edu!bloom-beacon.mit.edu!news.bu.edu!inmet!dsd!stt From: stt@dsd.camb.inmet.com (Tucker Taft) Subject: Re: The 'BASE Attribute Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: Date: Tue, 29 Nov 1994 04:52:13 GMT Date: 1994-11-29T04:52:13+00:00 List-Id: In article , Program Validation L wrote: >We are confused by the meaning of the 'BASE attribute. For example, the >LRM states that a fixed point type declaration of the form: > >type T is delta D range L .. R; > >is, by definition, equivalent to the following declarations: > >type fixed_point_type is new predefined_fixed_point_type; >subtype T is fixed_point_type > range fixed_point_type(L) .. fixed_point_type(R); > >We would therefore expect T to denote the (implicitly declared) subtype, >and T'BASE to denote the anonymous type fixed_point_type. This would mean >that T'DELTA is valid, whilst T'BASE'DELTA is invalid, since P'DELTA is >only defined for fixed point subtypes. Both T and T'Base are fixed point subtypes (every type is a subtype of itself in Ada 83). Note that in Ada 9X, the only nameable things are "subtypes"; "types" are anonymous abstractions. Either way, T'Base'Delta is legal, and equal to T'Delta in the absence of an accuracy constraint (called a "delta constraint" in Ada 9X). >However, both the Alsys and DEC Ada compilers accept both T'DELTA and >T'BASE'DELTA, which leads us to suppose our understanding of the LRM is >incorrect. The compilers are correct. In general, all type-oriented attributes are defined for all subtypes, including the type itself. The general confusion between "type" and "subtype" led us to use the term subtype uniformly in Ada 9X for things that you can name; "type" is the underlying abstraction on which all the subtypes are based. -Tucker Taft stt@inmet.com Ada 9X Mapping/Revision Team Intermetrics, Inc. Cambridge, MA 02138