あなたのコードフラグメントには、i または i への他の代入に関するループがありません。
'genmatrix' を使用して行列を作成し、次に n をループしていくつかの行列を生成することを検討してください。例えば:
foo : lambda ([i, j], if i < j then i + j + n else 0);
for n:1 thru 11 do aa[n] : genmatrix (foo, 21, 21);
それから私は得る
aa[5][2, 2];
=> 0
aa[5][2, 3];
=> 10
grind (aa[10]);
=> matrix([0,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],
[0,0,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],
[0,0,0,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],
[0,0,0,0,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],
[0,0,0,0,0,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],
[0,0,0,0,0,0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],
[0,0,0,0,0,0,0,25,26,27,28,29,30,31,32,33,34,35,36,37,38],
[0,0,0,0,0,0,0,0,27,28,29,30,31,32,33,34,35,36,37,38,39],
[0,0,0,0,0,0,0,0,0,29,30,31,32,33,34,35,36,37,38,39,40],
[0,0,0,0,0,0,0,0,0,0,31,32,33,34,35,36,37,38,39,40,41],
[0,0,0,0,0,0,0,0,0,0,0,33,34,35,36,37,38,39,40,41,42],
[0,0,0,0,0,0,0,0,0,0,0,0,35,36,37,38,39,40,41,42,43],
[0,0,0,0,0,0,0,0,0,0,0,0,0,37,38,39,40,41,42,43,44],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,40,41,42,43,44,45],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,42,43,44,45,46],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,44,45,46,47],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,46,47,48],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,48,49],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,50],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])$