Re: Rule Writing for x and 1/x

*To*: mathgroup at christensen.cybernetics.net*Subject*: [mg923] Re: Rule Writing for x and 1/x*From*: Gennady <stupakov at slac.stanford.edu>*Date*: Wed, 3 May 1995 00:02:08 -0400*Organization*: SLAC

In article <3mnk14$dse at news0.cybernetics.net> REECE_D, REECE+_D%A1%Electromagnetic_Sciences at mcimail.com writes: > Is there a way to write a single rule in MMA which will turn J/s into W >and s/J into 1/W? > > {J/s->W} only works for case#1. What about this: In[60]:= rul={J->W s} Out[60]= {J -> s W} In[61]:= s/J/.rul Out[61]= 1 - W In[62]:= J/s/.rul Out[62]= W Regards, Gennady