Re: More /.{I->-1} craziness

*To*: mathgroup at smc.vnet.net*Subject*: [mg106114] Re: More /.{I->-1} craziness*From*: Richard Fateman <fateman at cs.berkeley.edu>*Date*: Fri, 1 Jan 2010 05:39:25 -0500 (EST)*References*: <200912300915.EAA17299@smc.vnet.net> <hhhmn8$o9t$1@smc.vnet.net>

Leonid Shifrin wrote: ... > > I think that there are not many more objects in Mathematica which are as > tricky as <I> or Infinity in terms of pattern-matching. I agree. That's why it can be fixed. Here's a beginning of a short list for the "we're not just talking syntactic replacement-- version of substitution": If the user says -i --> i, then do Complex[a_,-b_] -> Complex[a,b]. If the user says x^2 --> y, then do x^(-2)-> 1/y also. I assume this list can be enlarged somewhat, and could even be left open-ended by user option of some sort. [e.g. should x^2--> y also change x^3 to x*y? or to y^(3/2) or ....] .... > It would perhaps be nice if such > cases were more systematically documented, but they have nothing to do with > bugs, You are right if you mean "bug in Mathematica implementation of intended design" (this is not such a bug). But there is another concept: "bug in Mathematica design, contrary to reasonable mathematical expectation" (this IS such a bug).