MathGroup Archive 1998

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

Search the Archive

Re: A simple bug..


  • To: mathgroup@smc.vnet.net
  • Subject: [mg12074] Re: A simple bug..
  • From: Paul Abbott <paul@physics.uwa.edu.au>
  • Date: Sat, 25 Apr 1998 01:30:11 -0400
  • Organization: University of Western Australia
  • References: <6h70sd$o@smc.vnet.net>

Dr. Jagannatha Rao wrote:

> I seem to have come across this  simple and reproducible bug :

It is not a bug -- this is the way the pattern-matcher works.  You need
to use ReplaceRepeated, i.e.,

	?ReplaceRepeated

	"expr //. rules repeatedly performs replacements until expr no longer
	 changes."

instead of ReplaceAll:

	?ReplaceAll

	"expr /. rules applies a rule or list of rules in an attempt to
transform
	 each subpart of an expression expr."

I.e.,

	k1matrix=Table[k1[i,j], {i,4},{j,4}] //. {h->6, e*in ->10^6}

Cheers,
	Paul 

____________________________________________________________________ 
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia            Nedlands WA  6907       
mailto:paul@physics.uwa.edu.au  AUSTRALIA                            
http://www.pd.uwa.edu.au/~paul

            God IS a weakly left-handed dice player
____________________________________________________________________



  • Prev by Date: Re: definite integral bug (3.0)
  • Next by Date: Problems connecting to remote kernel
  • Prev by thread: RE: A simple bug..
  • Next by thread: add-on Geometry`Polytopes` : Faces