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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,74b55538385b7366 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Which is right here - GNAT or OA ? Date: 1999/06/01 Message-ID: <3754594D.F1E07B47@averstar.com>#1/1 X-Deja-AN: 484628511 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <928083159.436.79@news.remarQ.com> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-01T00:00:00+00:00 List-Id: Florian Weimer wrote: > ... > Another but related thing surprises me---it's AARM 12.5.4(4.a): > > | If no _modifier applies to the formal, then the actual type may be > | either a pool-specific or a general access-to-variable type. > > I can't imagine any reason why an access-to-variable type should be > allowed as an actual parameter for a formal access type without an > `all' modifier. If this was changed, an access-to-variable would not be > allowed as a parameter in an instantiation of Ada.Unchecked_Deallocation, > which seems quite reasonable to me. (I don't claim that the language > definition inadequate here, I simply can't make sense out of it, which > is very likely my own fault. ;) You may be parsing the sentence incorrectly. It is saying that the actual type may be a (pool-specific or general) access-to-variable type. It certainly must be an access-to-variable type, unless the "constant" modifier is present. By omitting the "all" modifier, you are allowing either kind of access-to-variable type, pool-specific or general. Within the generic unit, the formal type is considered pool-specific. This works because the capabilities of a pool-specific access type are a subset of the capabilities of a general access type. This is analogous to the way "limited" is used in generic formal types. If present, either a limited or a non-limited actual type is used. If the word "limited" is absent, then only a non-limited actual type may be used. In general, a formal type specifies the minimum set of properties required. It is safe to provide an actual type with more properties than what is presumed for the formal. -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA