MathGroup Archive 1997

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

Search the Archive

Re: Replace expressions


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






  • Prev by Date: Lighting
  • Next by Date: problem of notebook in 16bit X server
  • Previous by thread: Re: Replace expressions
  • Next by thread: Re: Replace expressions