Question: Defining functions inside a loop

Hi everyone,

I'm trying to define indexed functions inside a for loop. However, after the loop is completed, the indexes of the functions are replaced by the índex of the control variable of the loop plus one. For example, I can make successfully the code:

for i from 1 to n do a[i] := b[i]; od;

However, if I try to define the functions a[i](u), through the code 

for i from 1 to n do a[i] := u-> b[i](u); od;

 I get wrong assignments. For example, Maple returns to me, for any i<=n, a[i](u) = b[n+1](u). 

I'm using Maple 2019 on Windows. Is this a bug? There is a right way to do these function assignments inside a loop?

Best regards for all,

R. S. Vieira.

Please Wait...