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

*To*: mathgroup at smc.vnet.net*Subject*: [mg106613] Re: [mg106595] Re: More /.{I->-1} craziness, con brio*From*: Andrzej Kozlowski <akozlowski at gmail.com>*Date*: Mon, 18 Jan 2010 02:36:26 -0500 (EST)*References*: <200912300915.EAA17299@smc.vnet.net> <hhhmn8$o9t$1@smc.vnet.net> <his71l$lad$1@smc.vnet.net> <201001171213.HAA09349@smc.vnet.net>

On 17 Jan 2010, at 13:13, Richard Fateman wrote: > (con brio, musical notation for With Vigor). > > With[{I=-I}, 3+4 I] returns 3-4 I, so clearly this could be used, as > someone mentioned waay back in this thread. Or can it? > > Let us try v=3+4I; With[{I=-I},v] returns 3+4I. > > oops. and > > With[{1/5=OneFifth}, 3/5] > > which gives an error message, that says that you can't use 1/5 as a > local variable because it is not a symbol. > > It is true that Head[1/5] is Rational, and hence 1/5 is not a symbol. > But Head[I] is Complex, and is not a symbol either, and so should > not be allowed. I suppose one could argue that error message is just > wrong. (but if you care, the explanation is below.) Except that this is all completely wrong. Head[I] is indeed Complex but Head[Unevaluated[I]] Symbol And since we have Attributes[With] {HoldAll,Protected} I is never evaluated and is seen as an object with Head Symbol. So everything works for this reason, the message is quite correct and the your entire argument is completely off target. Andrzej Kozlowski

**References**:**Re: More /.{I->-1} craziness, con brio***From:*Richard Fateman <fateman@cs.berkeley.edu>