Re: transforming a rule of lists to a list of rules
- To: mathgroup at smc.vnet.net
- Subject: [mg69157] Re: transforming a rule of lists to a list of rules
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 31 Aug 2006 04:39:18 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ed3qil$rn5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ken Senior wrote: > Hello everyone. > > Does anyone know a way to transform a rule involving a list into a list > of individual rules, that is to interpret the rule elementwise? For > example, given > > {a,b,c} -> {0,3,x} > > is there a transformation which will turn this into > > {a->0, b->3, c->x} > > Thanks for the help! > > Ken > Hi Ken, Use the Mathematica built-in function Thread [1]. In[1]:= Thread[{a, b, c} -> {0, 3, x}] Out[1]= {a -> 0, b -> 3, c -> x} Regards, Jean-Marc [1] http://documents.wolfram.com/mathematica/functions/Thread