Re: Q: ReplaceAll with pattern in pattern
- To: mathgroup at smc.vnet.net
- Subject: [mg18517] Re: [mg18459] Q: ReplaceAll with pattern in pattern
- From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
- Date: Thu, 8 Jul 1999 22:32:54 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Just use //. (ReplaceRepeated) instead of /. (Replace). -- Andrzej Kozlowski Toyama International University JAPAN http://sigma.tuins.ac.jp http://eri2.tuins.ac.jp ---------- >From: handel at hrzpub.tu-darmstadt.de (Christoph) To: mathgroup at smc.vnet.net >To: mathgroup at smc.vnet.net >Subject: [mg18517] [mg18459] Q: ReplaceAll with pattern in pattern >Date: Wed, Jul 7, 1999, 1:11 PM > > howdy, > > At the top of a notebook i want to define some constants like that: > > shorts={a -> b^2,d -> a/f} > values={b -> 42,f -> 27} > > and now i want to do some calculations using a,b,d,f as symbols: > > matrix={{a,b},{d,f}} > > and now I need to show the matrix: > > matrix //MatrixForm > > and now I want to know numerical values. > > matrix /.shorts /. values > > > but this won't do the job. When the shorts are done, there are still > some a left, because they were introduced with the second replacement > rule. Is there any way to do things like that? > > Greetings > Christoph > > PS: Mathematica 3.0 on NT > PPS: please also use eMail to reply