MathGroup Archive 1998

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

Search the Archive

Thread and Set


I'd like to use Thread and Set to define a number of variables.  The
following works as expected:

In[86]:=Clear[a,b]
In[87]:=Thread[Set[{a,b},{1,2}]]
Out[87]={1,2}
In[88]:=a
Out[88]=1
In[89]:=b
Out[89]=2

But why doesn't the following work?

In[101]:=Clear[a,b]
In[102]:=vars={a,b}
Out[102]={a,b}
In[103]:=nums={1,2}
Out[103]={1,2}
In[104]:=Thread[Set[vars,nums]]
Out[104]={1,2}
In[105]:=a
Out[105]=a
In[106]:=b
Out[106]=b
In[107]:=vars
Out[107]={1,2}

thanks in advance

Alex

Alex Tabarrok
Department of Economics
Ball State University
00ATTabarrok at bsuvc.bsu.edu


  • Prev by Date: Linux: couldn't reach []{} with latin2 keyboard layout
  • Next by Date: Re: Problem plotting a piecewise function
  • Previous by thread: Linux: couldn't reach []{} with latin2 keyboard layout
  • Next by thread: Re: Thread and Set