17.2.6 Expression defaults for generic formal functions

The declaration of a generic formal function is allowed to specify an expression as a default, using the syntax of an expression function.

Here is an example of this feature:

generic
   type T is private;
   with function Copy (Item : T) return T is (Item); -- Defaults to Item
package Stacks is

   type Stack is limited private;

   procedure Push (S : in out Stack; X : T); -- Calls Copy on X
   function Pop (S : in out Stack) return T; -- Calls Copy to return item

private
   -- ...
end Stacks;

Link to the original RFC: ‘https://github.com/AdaCore/ada-spark-rfcs/blob/master/prototyped/rfc-expression-functions-as-default-for-generic-formal-function-parameters.rst