Re: Evaluation and replacement?
- To: mathgroup at smc.vnet.net
- Subject: [mg42505] Re: Evaluation and replacement?
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Sat, 12 Jul 2003 05:19:06 -0400 (EDT)
- References: <beln4d$gm0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
f[expr_, r_Rule] := f[expr, r, Cases[r[[1]], _Symbol][[1]]]; f[expr_, r_Rule, var_Symbol] := Module[{a}, expr /. (Solve[r[[1]]==(r[[2]] /. var :> a), var][[1]] /. a:>var)]; f[20m,10m->9m+n]//Expand 18 m+2 n Bob Hanlon In article <beln4d$gm0$1 at smc.vnet.net>, "AngleWyrm" <no_spam_anglewyrm at hotmail.com> wrote: << Given a quantity 20m, and a rule 10m->9m+n, how can I get the result 18m+2n? ( m doesn't equal n; 10m degenerates into 9m + n. 9m doesn't degenerate into 8m+n.)