Re: Symbols and Lists
- To: mathgroup at smc.vnet.net
- Subject: [mg39876] Re: [mg39832] Symbols and Lists
- From: Dr Bob <drbob at bigfoot.com>
- Date: Sun, 9 Mar 2003 05:30:15 -0500 (EST)
- References: <200303080749.CAA23600@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
ss = {a, b, c, d, e} dd = {1, 5, {3, 4}, 7, abc, {0.1, 0.001}, 3.1415} ToExpression[ToString@ss[[3]] <> "=" <> ToString@dd[[4]]]; c Bobby On Sat, 8 Mar 2003 02:49:47 -0500 (EST), Goyder Dr HGD <H.Goyder at rmcs.cranfield.ac.uk> wrote: > Dear MathGroup, > > I am doing something much more complicated but this trivial example > expresses my difficulty. > > If I have a list of symbols and a list of data such as > > ss = {a, b, c, d, e} > > dd = {1, 5, {3, 4}, 7, abc, {0.1, 0.001}, 3.1415} > > how do I take a symbol from the list ss and associated it with data from > the > list dd? > > A wrong attempt is to try > > ss[[3]] = dd[[4]] > > This replaces element 3 in ss with element 4 from dd. > > What I need is an assignment so that, in this case, the symbol c is > associated with the data. Equivalent to writing > > c = dd[[4]] > > so that c could then be used in subsequent expressions and the list ss is > unchanged. > > Note that this is a trivial example for pedagogic purposes - I can't do > the > simple assignment in my actual case. > > Thanks > > Hugh Goyder > > > -- majort at cox-internet.com Bobby R. Treat
- References:
- Symbols and Lists
- From: Goyder Dr HGD <H.Goyder@rmcs.cranfield.ac.uk>
- Symbols and Lists