MathGroup Archive 2001

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

Search the Archive

Re: List Assignment Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31812] Re: List Assignment Question
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Mon, 3 Dec 2001 01:45:02 -0500 (EST)
  • References: <9ucthj$dsa$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jim, Try this,

data = {abc, 1, 2.3, 3, 4};
Apply[Set, { First[data], Rest[data]}];

In[3]:=?abc

In[3]:=?abc

abc = {1, 2.3, 3, 4}

Cheers,

Brian


Jim Purdy <jpurdy at home.com> wrote in message news:<9ucthj$dsa$1 at smc.vnet.net>...
> Hello,
> 
> I want to do the following:
> 
> Given the list ,
> 
> data={abc, 1, 2.3, 3, 4}
> 
> do this:
> 
> First[data]=Rest[data]  (wont work)
> 
> basically creating a variable named for the first element in the list
> and assigning it to the remainder.
> 
> abc={1,2.3,3,4} would be the result.
> 
> There probably is a simple answer, but I can't find it.
> 
> Thanks in advance
> 
> Jim


  • Prev by Date: Re: List Assignment Question
  • Next by Date: Re: List Assignment Question
  • Previous by thread: Re: List Assignment Question
  • Next by thread: Re: List Assignment Question