MathGroup Archive 2006

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

Search the Archive

Re: delayed rule evaluation order

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67977] Re: [mg67967] delayed rule evaluation order
  • From: "Carl K. Woll" <carlw at wolfram.com>
  • Date: Thu, 20 Jul 2006 06:04:10 -0400 (EDT)
  • References: <200607190921.FAA21363@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Chris Chiasson wrote:
> Hold[{2, 3}] /. {{x_, y_} :> x^y}
> 
> the result is Hold[Power[2,3]]
> 
> I would like the result to be Hold[8]
> 
> The original context is post-processing of a large Trace output (via
> SetPrecision to get rid of digits and improve readability).
> 
> Any ideas?
> 

This is not an easy one to figure out. One possibility is given in the 
help for ReplaceAll in the last example of the Further Examples section. 
In this example the following construct is used:

In[27]:= Hold[{2, 3}] /. {x_, y_} :> With[{p = x^y}, p /; True]

Out[27]= Hold[8]

Carl Woll
Wolfram Research


  • Prev by Date: Re: writing ASCII-files in UNIX-format from Windows
  • Next by Date: Re: delayed rule evaluation order
  • Previous by thread: Re: delayed rule evaluation order
  • Next by thread: Re: delayed rule evaluation order