Question: local variables and strings

To those who read this post.

 

I have a question about the property of local variables in a procedure.

Are names at the local variables in procedures, strings not names? 

If so, why can strings be evalated to have Integer, which is numbers for counting for continuing repetition? 

This is the code which searches for the maximum value. 

**************************************************

Max2 := proc()

local i, m :: string;
if nargs = 0 then
return -infinity
end if;
m:= args[1];
for i from 2 to nargs do
if args[i] > m then
m := args[i]
end if;
end do;
m;
end proc:
Max2(1,7,5,4,6,10,35,63.5,-10,5);

 ************************************************

type(a,name);

              this answer was true.

type(1, string)

              this answer was false, of course.

 

I limited the values of local variables to be string.

But, to the sequence 1,7,5,4,6,10,35,63.5,-10,5, any error messages wouldn't appear.

I hope any of you will give me an answer.

Thank you in advance.

 

taro yamada

 

 

 

 

 

Please Wait...