MathGroup Archive 2012

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

Search the Archive

Re: replace one rule in a list of rules


On Mar 17, 12:54 am, Kathryn Isaac <kathryn.is... at gmail.com> wrote:
> I have a list of simple rules. I want to repeatedly replace one of
> them.  Is the best way to simply prepend the new rules, or is there
> a "prettier" approach?
>
> Thanks,
> Alan Isaac

If all you want to change is the right-hand side of the rule
then use RuleDelayed with a dummy right-hand-side variable:

rlist = {a -> a1, b :> bx};
bx = b1; {a,b}/.rlist
bx = b2; {a,b}/.rlist

{a1,b1}
{a1,b2}



  • Prev by Date: Re: replace one rule in a list of rules
  • Next by Date: Re: Solving multiple equations
  • Previous by thread: Re: replace one rule in a list of rules
  • Next by thread: Re: replace one rule in a list of rules