Newbie question about scoping rules



Sorry for all the questions but maxima behaves quite differently from
the languages I am used to (python, c)

I don't understand the behaviour of the following program

g(s):=block([i],
  for i:0 thru 5 do print(s[i])
);

f(s):=block([i],
  local(t),
  for i:0 thru 10 do t[i]:s[2*i],
  g(t)
);

s[n]:=n^2;
p[n]:=n^2;

f(p);

Answer:
0
1
4
9
16
25

(I was expecting the squares of even numbers)

kill(s);

f(p);
0
4
16
64
100

Now it works....

Michel