Re: Replace expressions
- To: mathgroup at smc.vnet.net
- Subject: [mg7691] Re: Replace expressions
- From: Vanessa Portioli Rolnik <vanessa at icmsc.sc.usp.br>
- Date: Sun, 29 Jun 1997 22:17:26 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello all, I have expressions of the type: test=u[i,{1,j},{2,k},t] and I want to perform the following replacements: i->0,t->0,{1,j}->1*j and {2,k}->2*k to get u[0,j,2k,0] I use the following command test/.{{a_Integer,b_Symbol}->a*b,c_Symbol->0} but I the result is 0[0, 0[1, 0], 0[2, 0], 0] instead of what I expected it to be: u[0,j,2k,0] I need a command to hold the head of the expression and the lists, or a better way to perform this replacement. Please answer by email to vanessa at icmsc.sc.usp.br. If there is enough interest, I will post the answers to the net. Thanks in advance for any help, Vanessa