Question: error in proc

Question:error in proc

nmani 136 Maple

Hi

I have a problem which works properly outside the proc but when it is inside the proc I see an error which says: illegal use of a formal parameter.

What should I do?

Here is that procedure:

simp := proc (L, k)
local var, i, newL;
var := [seq((cat(X, i))(t), i = 1 .. k)];
for i to nops(L) do
if member(lhs(L[i]), var) then
L := subs(L[i], L)
elif member(rhs(L[i]), var) then
L[i] := rhs(L[i]) = lhs(L[i]);
L := subs(L[i], L)
end if;
if member(-lhs(L[i]), var) then
L := subs(-L[i], L)
elif member(-rhs(L[i]), var) then
L[i] := rhs(L[i]) = lhs(L[i]);
L := subs(-L[i], L)
end if
end do;
newL := [];
for i to nops(L) do
if not evalb(L[i]) then
newL := [op(newL),
L[i]]
end if
end do
end proc

Impelementaion of this proc gives an error.

Thanks,

 

Please Wait...