MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

SOme problems with "Save"


Hi,

When saving a definition, Mathematica attaches all linked definitions,
which is normal; so if you have:

x=1
f[z_]:=a+z

a Save["file.m",f] will produce;

f[z_]:=a+z
x=1

That's fine, but if you try this:

f[z_]:=1+z
z=1 (* Global variable *)

you will get z=1 in your save file, so the next time you load your file 
you'll get the variable z modified! This problem comes from
FullDefinition which considers global definitions as needed for a
function with the same arguments or local variables names.

Another example:

f[z_]:=Block[{x},z]
x=1

Here also, FullDefinition is wrong thinking the global definition of x
is needed in the function f.

Any idea how to correct this problem?

Thanx.
\/\\/\/\/>> Gadi ORON <<\/\/\/\/
EMAIL :  oron at pmmh.espci.fr  
Homepage : http://www.pmmh.espci.fr/~oron/personal.html ICQ#7316619



  • Prev by Date: Re: Images in Mathematica
  • Next by Date: MATHEMATICA COURSE BY PROF.DR. FRED SIMONS
  • Previous by thread: Electrodynamics
  • Next by thread: Re: SOme problems with "Save"