Re: How To Change A Rule
- To: mathgroup at smc.vnet.net
- Subject: [mg32346] Re: How To Change A Rule
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 16 Jan 2002 03:29:55 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <a20mon$4hf$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, sound very complicated .. but rules = {s1 -> -11, s2 -> 12} /. (a_ -> b_ /; b < 0) :> (a -> 0) may work. Regards Jens Ariel Fligler wrote: > > Greetings, > > I'm quite newby to Mathematica programming and will thank you if you could > help me solve the following: > > I have a list of rules of the form: > {s1->-11, s2->12} > And would like to change every rule in the list that it's RHS is negative to > 0 so that I will get: > {s1->0, s2->12} > I tried to find an access function to manipulate rules but could not. > > Any help ? > > TIA, > > Ariel. > > Thanks, > > Ariel Fligler