Can someone simplify this code?

Has someone a hint on how to simplify this code (I have a feeling
of missing something in my understanding):

package S_p is new Ordered_Sets(Element_Type => Positive);
n_set1 : constant S_p.Set := [for n in n1 … n2 => n];
n_set2 : constant S_p.Set := [for n of n_set1 when csa(n).image_hour1 in t1 … t2 => n];
r_array1 : constant r_array1_t := [for n of n_set2 => cella(id).track1(smooth,n)];

The purpose here is to produce “r_array1” (n_set1 and n_set2 are there only to construct r_array1).


It looks like set2 is a set of t(ime) of set_1. Far as I can tell there are 2 ways I read this:

  1. The program try to make an enumeration of n where each n range from t1…t2.
  2. The program try to make a 2D array ((n1…n2),(t1…t2)).

I’m probably wrong, but that’s my best read.

“r_array1” is a 1D array.

The compiler does not like the construct “[for n in n1 … n2 when test(n) => n]”, but
it accepts “[for n of a_set when test(n) => n]”.