Question: use ... in ... end use

I have a Mma code from a colleague that I am trying to port to Maple. This code uses a lot of Mma With[{...}, ...] constructs, to which I found the Maple "use ... in ... end use" construct the closest equivalent. What is being done is to initialize a bunch of local variables and then run the calculations. Non-initialized variables (the ones not in the first section) remain global.

I ran into a problem in Maple when I tried to initialize an element of a Vector, like "use a[1]=1". By experimentation I found that Vectors (or Arrays) cannot be initialized this way in "use". "subs" of course works. (Incidentally, I ran into this when using "use" in one of my own pieces of code so I do not claim that, or know if, in Mma's With[] I can initialize list elements.)

Which then begs the larger question: Am I abusing "use...in...end use"? Is there a better equivalent to Mma's With[]?

Thanks,

Mac Dude

Please Wait...