Re: ReplaceAll behavour
- To: mathgroup at smc.vnet.net
- Subject: [mg82152] Re: [mg82111] ReplaceAll behavour
- From: adriano.pascoletti at dimi.uniud.it
- Date: Sat, 13 Oct 2007 03:55:31 -0400 (EDT)
> I do not understand what Mathematica 6 is doing here: > > a=5 > a/.a->3 > > gives 3 > > But... > > a+2/. a->3 > > gives 7 > > Why is that? > > Thank you for your help > Being a=5 the statement a+2/. a->3 becomes 7/.5->3. You can check it with Trace: In[5]:= Trace[a + 2 /.a -> 3] Out[5]={{{a,5},5+2,7},{{a,5},5->3,5->3},7/.5->3,7} Adriano Pascoletti