Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

RE: How To Change A Rule

  • To: mathgroup at
  • Subject: [mg32376] RE: [mg32339] How To Change A Rule
  • From: Ariel Fligler <ariel.fligler at>
  • Date: Thu, 17 Jan 2002 02:23:28 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hello All,

There seem to be a double posting to the list of my question. Sorry for that
and thank all of you who helped me solve my problem.

{s1 -> -11, s2 -> 12} /. (x_ -> n_ /; n < 0) -> (x -> 0)
{s1 -> 0, s2 -> 12}



-----Original Message-----
From: Ariel Fligler [mailto:ariel.fligler at]
To: mathgroup at
Subject: [mg32376] [mg32339] How To Change A Rule


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 right hand side 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 will be greatly appreciated.



  • Prev by Date: Re: Switch rows!
  • Next by Date: Re: How To Change A Rule
  • Previous by thread: Re: How To Change A Rule
  • Next by thread: Re: How To Change A Rule