--- ai12s/ai12-0190-1.txt 2018/03/30 07:55:08 1.7 +++ ai12s/ai12-0190-1.txt 2018/12/12 06:16:31 1.8 @@ -1,5 +1,8 @@ -!standard 5.5.2(2/3) 18-02-28 AI12-0190-1/04 +!standard 4.4(7/3) 18-12-11 AI12-0190-1/05 +!standard 4.5.9(0) !class Amendment 16-06-02 +!status Amendment 1-2012 18-12-10 +!status ARG Approved 9-0-2 18-12-10 !status work item 16-06-02 !status received 16-05-06 !priority Low @@ -81,7 +84,7 @@ function_formal_parameter_list ::= formal_part | (identifier {, identifier}) - Name Resolution + Name Resolution Rules In a context where there is an expected type rather than an expected profile for a function_expression, the expected type shall be a single @@ -107,7 +110,7 @@ function_expression replaced by a name denoting this locally defined function. The profile of this locally defined function has a result type determined by the expected profile, and a formal part determined - by the formal_part, if provided in the expression_function, or by the + by the formal_part, if provided in the function_expression, or by the formal part of the expected profile otherwise, but with the name of each formal parameter of the expected profile replaced by the corresponding identifier in the sequence of identifiers. The expression @@ -163,6 +166,70 @@ -- Plot a graph of X-squared from 1 to 20 Plot_Graph (Fun => (function (Z) return Z**2), Start => 1.0, Stop => 20.0); + +!corrigendum 4.4(7/3) + +@drepl +@xcode<@fa<primary ::=> + @fa<numeric_literal | >@ft<@b<null>>@fa< | string_literal | aggregate> + @fa<| name | allocator | (expression)> + @fa<| (conditional_expression) | (quantified_expression)>> +@dby +@xcode<@fa<primary ::=> + @fa<numeric_literal | >@ft<@b<null>>@fa< | string_literal | aggregate> + @fa<| name | allocator | (expression)> + @fa<| (conditional_expression) | (quantified_expression)> + @fa<| function_expression>> + +!corrigendum 4.5.9(0) + +@dinsc + +Function expressions provide a way to define a function at a point +where an access-to-function type is the expected type, or in a generic +instantiation as an actual parameter corresponding to a formal subprogram +parameter. + +@s8<@i<Syntax>> + +@xcode<@fa<function_expression ::=> + @fa<(>@ft<@b<function>>@fa< [function_formal_parameter_list] >@ft<@b<return>>@fa< expression)>> + +@xcode<@fa<function_formal_parameter_list ::=> + @fa<formal_part | (identifier {, identifier})>> + +@s8<@i<Name Resolution Rules>> + +In a context where there is an expected type rather than an expected +profile for a @fa<function_expression>, the expected type shall be a single +access-to-function type, and the profile of this type is considered +the expected profile for the @fa<function_expression>. The result type of +the expected profile of the @fa<function_expression> is the expected type +for the expression of the @fa<function_expression>. If there is no +@fa<function_formal_parameter_list>, the expected profile shall have no +parameters. If the @fa<function_formal_parameter_list> is a @fa<formal_part>, +then it shall be subtype conformant to the expected profile if there +is an expected type, or merely mode conformant otherwise. If the +@fa<function_formal_parameter_list> is a sequence of identifiers, the +number of identifiers in the sequence shall be the same as the number +of formal parameters in the expected profile. + +@s8<@i<Static Semantics>> + +A @fa<function_expression> used in a context where there is an expected +type is equivalent to a local @fa<expression_function_declaration> (see +6.8), with the @fa<function_expression> replaced by an Access +@fa<attribute_reference> of this locally defined function; otherwise, the +@fa<function_expression> is equivalent to such a local declaration with the +@fa<function_expression> replaced by a @fa<name> denoting this locally defined +function. The profile of this locally defined function has a result +type determined by the expected profile, and a formal part determined +by the @fa<formal_part>, if provided in the @fa<function_expression>, or by the +formal part of the expected profile otherwise, but with the name of +each formal parameter of the expected profile replaced by the +corresponding identifier in the sequence of identifiers. The @fa<expression> +of this locally defined expression function is that of the +@fa<function_expression>. !ASIS

Questions? Ask the ACAA Technical Agent