Re: Order of execution of initialization cells
- To: mathgroup at smc.vnet.net
- Subject: [mg8932] Re: Order of execution of initialization cells
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sat, 4 Oct 1997 22:08:09 -0400
- Organization: University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
John E. Derwent wrote: > Using 3.0.1, consider the two commands: > > <<Calculus`VectorAnalysis` > SetCoordinates[Cartesian[x,y,z]] > > Each of these is in its own cell, which is an Initialization Cell. I want > to load the package and then change the coordinates from the default {Xx, > Yy,Zz} to the more usual {x,y,z} (which incidentally were the default in > 2.2). When the first cell is evaluated, what should happen? After I > indicate that I do want to evaluate all Initialization Cells, In[1] appears > before the first command, then In[2] appears before the second command, and > there is the expected output to the second command, and then In[3] appears > before the first command, and then execution is complete. But the > coordinates have been set back to the default {Xx, Yy,Zz} instead of to > {x,y,z}. I've tried this both on a Mac and a Sparc, with the same result. I tried this on a Macintosh. When the first two cells are initialization cells, I selecte the _second_ cell and hit Enter. I say Yes to evaluating all intitialization cells and this is the output I get: In[1]:= <<Calculus`VectorAnalysis` In[3]:= SetCoordinates[Cartesian[x,y,z]] Out[3]= Cartesian(x,y,z) In[4]:= Coordinates[] Out[4]= {x,y,z} I am puzzled about what happened to In[2] but the coordinates certainly have been set to {x,y,z}. However, if I select the _first_ cell and hit Enter I get: In[3]:= <<Calculus`VectorAnalysis` In[2]:= SetCoordinates[Cartesian[x,y,z]] Out[2]= Cartesian(x,y,z) In[4]:= Coordinates[] Out[4]= {Xx,Yy,Zz} which agrees with your statement above. I think that this is a bug and I have forwarded it to bugs at wolfram.com. Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://www.pd.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________