Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: replacement x->y except in Exp[x]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110889] Re: replacement x->y except in Exp[x]
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sat, 10 Jul 2010 04:01:03 -0400 (EDT)

I is not a "symbol"!

   Head[I]
Complex

   3+I /. I-> -I
3 + I

   Head[2]
Integer

   (2/3) /. 2->5
2/3

Please stop beating the dead horse.


On 7/8/2010 8:34 PM, AES wrote:

> ...Is it ever a good idea to use ReplaceAll to do word-processing-type
> "global find and replace" changes like this?
>
> Lengthy threads on this NG have pointed out the havoc that this can
> wreak if the symbol I is among those replaced, particularly if one
> attempts to do I ->  -I.
>
> Or is I the _only_ symbol in the entire Mathematica vocabulary that
> encounters this difficulty?
>
> (I really would like to know the answer to this question, even if this
> is entirely out of curiosity, not any real need.  I've asked it
> previously, and never gotten an answer.)


-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: I am posting the problem once more
  • Next by Date: Re: Any idea how to parallelize this small code construct
  • Previous by thread: Re: replacement x->y except in Exp[x]
  • Next by thread: Re: replacement x->y except in Exp[x]