Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: replace one rule in a list of rules

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125570] Re: replace one rule in a list of rules
  • From: Alan <alan.isaac at gmail.com>
  • Date: Mon, 19 Mar 2012 04:57:58 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jk1fv4$515$1@smc.vnet.net> <jk44fj$e40$1@smc.vnet.net>

Using Murray's approach I end up with (for example):

Clear[a, b, c]
rules = Thread[{a, b, c} -> {0.1, 0.1, 0.1}]
Table[rules /. ((b -> _) -> (b -> i/10.)), {i, 0, 10}]

Using Peter's approach I end up with (for example):

Clear[a, b, c]
rules = Thread[{a, b, c} -> {0.1, 0.1, 0.1}]
Table[(rules /. HoldPattern[b -> _] :> b -> i/10.), {i, 0, 10}]

Both appear to meet my needs. I'm not sure what the real
difference between the two is.

Thanks,
Alan


Thanks!
Alan



  • Prev by Date: Different answers in mathematica and my calculator.
  • Next by Date: Re: Export Data and Decimal Separator
  • Previous by thread: Re: replace one rule in a list of rules
  • Next by thread: Re: replace one rule in a list of rules