Re: How to produce variable substitution list?
- To: mathgroup at smc.vnet.net
- Subject: [mg90923] Re: How to produce variable substitution list?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Wed, 30 Jul 2008 03:50:52 -0400 (EDT)
On 7/29/08 at 1:37 AM, stoneyb at gmail.com (Stoney Ballard) wrote:
>Is there a straight-forward way to write a function that takes a
>list of symbols that are bound in the calling environment and
>produce a list such as is produced by Solve, like {var1->val1,
>var2->val2,...}?
This is easily done using Thread. For example,
In[8]:= vars = {a, b, c};
values = RandomInteger[100, {3}];
Thread[vars -> values]
Out[10]= {a->13,b->71,c->13}