MathGroup Archive 2007

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

Search the Archive

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



  • Prev by Date: InverseFourierTransform strange behaviour
  • Next by Date: Re: Re: [Mathematica 6] Format->Magnification does
  • Previous by thread: ReplaceAll behavour
  • Next by thread: Re: ReplaceAll behavour