Suppose I have a list of rules with a mix of values and equations on the RHS.
eqn={a->1,x->a+y,y->b,b->2}
How can I update the list such that RHS is evaluated using all the rules (assuming the list of rules is exhaustive and covers all variables)? This is what I want:
eqn={a->1,x->3,y->2,b->2}
I can do
Thread[Rule[eqn[[;; , 1]], eqn[[;; , 2]] //. eqn]]
But it looks too messy. Is there a simple function for this?
MapAt[# //. eqn &, eqn, {All, 2}]
comes to mind. $\endgroup$MapAt
of course! Great! $\endgroup$