Version 1.2 of ai12s/ai12-0271-1.txt

Unformatted version of ai12s/ai12-0271-1.txt version 1.2
Other versions for file ai12s/ai12-0271-1.txt

!standard 13.1.1(3/3)          18-04-09 AI12-0271-1/00
!class Amendment 18-04-09
!status Hold by Letter Ballot (8-0-3) - 18-05-07
!status work item 18-04-09
!status received 15-03-20
!priority Low
!difficulty Medium
!subject Specifying aspects of (anonymous) formal parameters
!summary
** TBD.
!problem
It is not possible to specify aspects of anonymous access parameters, as there is no type declaration to hang the aspects on. One could declare a named access type to use instead (and put the aspects on). However, these parameters have special semantics (dynamic accessibility for anonymous access-to-object parameters, and closures for anonymous access-to-subprogram parameters), which are lost if a named access type is used.
!proposal
Allow the following syntax
with Param'Pre => ...
to specify the Pre aspect of a formal parameter Param (for instance, if Param is an anonymous access-to-subprogram parameter).
!wording
** TBD.
!discussion
Note that similar issues occur for SAOAATs (Stand-Alone Object of an Anonymous Access Type) and anonymous access discriminants, but it's unclear whether it is important to be able to specify aspects for those types. It's obvious that specifying Pre and Post is valuable for named access-to-subprogram types, and there's no reason for that value to only exist for named types.
An alternative approach is to define aspect(s) which all named access types to get the associated special semantics. This idea was rejected as it makes too much sense. ;-) [The author might want to replace this with a better reason - Editor.]
** Rest TBD.
!ASIS
[Not sure. It seems like some new capabilities might be needed, but I didn't check - Editor.]
!ACATS test
ACATS B- and C-Tests are needed to check that the new capabilities are supported.
!appendix

From: Tucker Taft
Sent: Monday, April 2, 2018  5:20 PM

Just to record the idea that came up in our ARG phone meeting today:

There may be times when it is useful to specify an aspect of a formal
parameter of a subprogram.  In those cases, a syntax such as the following
might make sense:

   with Param'Pre => ...

to specify the Pre aspect of a formal parameter Param (e.g. if Param is 
an anonymous access-to-subp parameter).

****************************************************************

From: Randy Brukardt
Sent: Monday, April 2, 2018  5:32 PM

Thanks. During the meeting, you suggested (or was it I heard?) a dotted 
notation. (That's certainly what I recorded.) I note here that it is more an
attribute-like notation. No big deal, but I wanted to note the discrepancy
for posterity.

****************************************************************

From: Tucker Taft
Sent: Monday, April 2, 2018  6:50 PM

You are correct, I initially suggested a dotted notation.  But on further 
thought, that didn't really make much sense, and could create ambiguity if
the parameter were of a record or access-to-record type.

****************************************************************

Questions? Ask the ACAA Technical Agent