title: Formal array type with the declared number of indexes (generic package)
body: <p>Generic package specification:</p>
  
  <pre class="lang-ada prettyprint-override"><code>generic
     type Real is digits &lt;&gt;;
     type Real_Arr is array (Integer range &lt;&gt;) of Real;
  package Pack1 is
     function Gt (A : in Real; B : in Real_Arr) return Boolean;
  end Pack1;
  </code></pre>
  
  <p>Generic package body:</p>
  
  <pre class="lang-ada prettyprint-override"><code>package body Pack1 is
     function Gt (A : in Real; B : in Real_Arr) return Boolean
     is
       (for all X of B =&gt; (X &gt; A));
  end Pack1;
  </code></pre>
  
  <p>For a function <code>Gt</code>, the dimension of <code>B</code> is not important.</p>
  
  <p>How can I do something like that?</p>
  
  <pre class="lang-ada prettyprint-override"><code>generic
     type Real is digits &lt;&gt;;
     --  Declare number of indexes?
     --  N : Positive;
     --  type Real_Arr is array (??? N ???) of Real;
  package Pack1 is
  </code></pre>
  
  <p>And use with different types:</p>
  
  <pre class="lang-ada prettyprint-override"><code>with Pack1;
  package Math is
     --  Array types are outside of generic package!
     type Vector is array (Positive range &lt;&gt;) of Float;
     type Matrix is array (Positive range &lt;&gt;, Positive range &lt;&gt;) of Float;
  
     package Opv is new Pack1 (Float, 1, Vector);
     package Opm is new Pack1 (Float, 2, Matrix);
  end Math;
  </code></pre>
  
  <p>I want to do this because the implementation of the function <code>Gt</code> is the same for arrays with any indexes and dimensions.</p>