MathGroup Archive 1997

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

Search the Archive

Re: Symbols, names, objects

  • To: mathgroup at
  • Subject: [mg6537] Re: [mg6515] Symbols, names, objects
  • From: penny at (Des Penny)
  • Date: Mon, 31 Mar 1997 23:01:36 -0500 (EST)
  • Sender: owner-wri-mathgroup at

>I need a function, let's call it Store, that takes two strings as
>arguments -- the NAMES of two variables the second ov which variables
>currently has some value -- and that causes the value in that variable
>to be assigned to the symbol.  (I don't care what the result returned
>by the function is; Null will do just fine.)  For example:
>    temp = {1, 2, 3};
>    Store["x", "temp"]
>After evaluating those expressions, the list {1,2,3} of numbers would
>be assigned to the variable x.


Part of the problem is that the Set (i.e. = ) function has a HoldFirst
attribute. We must therefore force it to evaluate its first argument (i.e.
the left hand side of the =). The following will work:


( Clear[Evaluate[a]];

temp = {1, 2, 3};

The variable x is now redefined:




Hope this helps.


Des Penny

Des Penny
Physical Science Dept.
Southern Utah University
Cedar City, UT 84720

VOICE: (Office): (801) 586-7708
       (Home)  : (801) 586-2286
FAX:    (801) 865-8051
e-mail: penny at

  • Prev by Date: Re: Re: graphic export in mma 3.0
  • Next by Date: Re: NDSolve problem
  • Previous by thread: Re: Re: graphic export in mma 3.0
  • Next by thread: Fwd: Symbols, names, objects