Question: Recovering un-returned local variables from a specific line seen from showstat(proc)

I would like to return local variable y (line 4 in showstat) in the attached dummy procedure (s1) without manually adding any comment inside the procedure s1. This procedure is a simple one and easy to copy paste/or change. When we have a long procedure, it is difficult to do so. I will always know the name of the local variable I want (say, y) and/or line number in showstat

Thanks

PS, I want to get y:=array(1..,2[(1)=x,2=zz])
 

restart;

s1:=proc(n,x)
local y,xx,i,j,zz::array(1..n,1..n);
for i from 1 to n do for j from 1 to n do zz[i,j]:=x[i]*(1+x[j]^2);od:
od:
y:=array(1..2,[(1)=x, (2)=zz]):
for j from 1 to n do xx[i]:=zz[i,i]/(add(zz[i,j],j=1..n));od:
0;
end proc;

s1 := proc (n, x) local y, xx, i, j, zz::(array(1 .. n, 1 .. n)); for i to n do for j to n do zz[i, j] := x[i]*(1+x[j]^2) end do end do; y := array(1 .. 2, [1 = x, 2 = zz]); for j to n do xx[i] := zz[i, i]/add(zz[i, j], j = 1 .. n) end do; 0 end proc

(1)

showstat(s1);

 

s1 := proc(n, x)

local y, xx, i, j, zz::array(1 .. n,1 .. n);

   1   for i to n do

   2     for j to n do

   3       zz[i,j] := x[i]*(1+x[j]^2)

         end do

       end do;

   4   y := array(1 .. 2,[1 = x, 2 = zz]);

   5   for j to n do

   6     xx[i] := zz[i,i]/add(zz[i,j],j = 1 .. n)

       end do;

   7   0

end proc

 

 

x0:=Vector(2,[1,1]);

x0 := Vector(2, {(1) = 1, (2) = 1})

(2)

s1(2,x0);

0

(3)

 


 

Download showstatexample.mws

Please Wait...