Applying a set of rules to a List
- To: mathgroup at yoda.physics.unc.edu
- Subject: Applying a set of rules to a List
- From: "Anthony Varghese" <avarg at s1.arc.umn.edu>
- Date: Mon, 25 Jan 93 19:21:15 CST
I would like to apply a set of rules to all the elements of a list and I've tried a number of things with no success. What I have is a set of equations in which certain variables are to be held at fixed values. The equations are stored as a list, say, oldEqns. The substitution rules are stored in a variable called fpRules. I need to get a new set of equations obtained by ReplaceAll'ing the old eqns with the fpRules. Here is one attempt: applyRules[item_] := ReplaceAll[item, fpRules] newEqns = Map[ applyRules, oldEqns ] Unfortunately this did not work; I don't see any difference between oldEqns and newEqns even though I KNOW there are places where the rules can be applied. Anyone see the problem? Thanks, Tony Varghese