Re: constant -> constant
- To: mathgroup at smc.vnet.net
- Subject: [mg41957] Re: constant -> constant
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 11 Jun 2003 13:17:45 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bc6nki$2hd$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, this is the correct behavior because after your assigments a /. b->1 evaluates to 0 /. 0 ->1 and if you wish to replace all 0 with 1 Mathematica will do that. You must tell us what you *wish* to do may be that: a = b = 0; Print[a /. b_Symbol :> 1]; help you Regards Jens Carlos Felippa wrote: > > I traced a bug in a large program to an unexpected > substitution. This gives the idea: > > a=b=0; Print [a/.b->1]; > > 1 > > Is this correct behavior and, is there a way to guard > against this happening?