Christian Wolinski

MaplePrimes Activity


These are questions asked by Christian Wolinski

Is there a difference between scoping rules for regular procedures and for arrow operators?

I've posted  a code for a procedure, but it seems it does not execute with other versions of Maple the way it does with my version (5.4). Here is the link. I am curious to identify within the procedure code the cause of this divergence. Note: in 5.4 the code is preceded with readlib(eliminate).
 

   Consider a surface of the unit sphere about the origin, intersecting the volume of the cube [-a..a,-a..a,-a..a] 0<a<1.  What is the best Maple method to plot this surface with a direct mapping, that is without use of implicit plotting over a volume or rejecting grid points?

In Maple V, Release 4 (1996):

 

T:=table():
i:=1:N:=5000;

for i from i to N  
do
   T[i]:=T[i+1]:
   T[i+1]:=1;
   eval(T[1]);
od:
print(i);

for i from i to N  
do
   T[i]:=T[i+1]:
   T[i+1]:=1;
   eval(T[1]);
od:
print(i);

I receive this output:

N := 5000
Error, too many levels of recursion
3607
5001

Can You explain this occurence, as well as the following one:

In Maple V, Release 4 (1996):

 

T:=table():
i:=1:N:=5000;

for i from i to N  
do
  T[i]:=T[i+1]:
  eval(T[1]);
od:
print(i);
 
for i from i to N  
do
  T[i]:=T[i+1]:
  eval(T[1]);
od:
print(i);;

gives:

N := 5000
Error, too many levels of recursion
3607
Error, too many levels of recursion
3607

How does one control allowance for recursion depth?

In Maple V, Release 4 (1996):

 

_EnvX:=0; b:=0; proc() global b; print(_EnvX, b); assign('_EnvX=1, b=1'); print(_EnvX, b); end();
_EnvX:=0: b:=0: proc() global b; print(_EnvX, b); _EnvX:=1; b:=1; print(_EnvX, b); end();;

gives:
                                 0, 0
                                 0, 1

In newer Maple:

 

_EnvX:=0; b:=0; proc() global b; print(_EnvX, b); assign('_EnvX=1, b=1'); print(_EnvX, b); end proc();
_EnvX:=0: b:=0: proc() global b; print(_EnvX, b); _EnvX:=1; b:=1; print(_EnvX, b); end proc();

?

First 7 8 9 10 11 Page 9 of 11