Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: Evaluation question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82175] Re: Evaluation question
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Sun, 14 Oct 2007 06:06:16 -0400 (EDT)
  • References: <200710120656.CAA04613@smc.vnet.net> <fepuqv$hvl$1@smc.vnet.net> <47109042.2000302@gmail.com>

Szabolcs Horvát wrote:
> It seems that Rule and RuleDelayed are "evaluated to themselves":
> 
> In[1]:= Trace[1->2+3]
> Out[1]= {{2+3,5},1->5,1->5}
> 
> In[2]:= Attributes[f]=Attributes[Rule]
> Out[2]= {Protected,SequenceHold}
> 
> In[3]:= Trace[f[1,2+3]]
> Out[3]= {{2+3,5},f[1,5]}
> 

Block[] can free Rule from this special behaviour:

In[1]:= Block[{Rule},1->Unevaluated[2+3]]//Trace

Out[1]= 
{Block[{Rule},1->Unevaluated[2+3]],{1->2+3,1->Unevaluated[2+3]},1->Unevaluated[2+3],1->2+3,1->2+3,{2+3,5},1->5,1->5}

-- 
Szabolcs


  • Prev by Date: Re: Can Integrate[expr,{x,a,b}] give an incorrect result?
  • Next by Date: Re: Manipulator Import in Powerpoint
  • Previous by thread: Re: Evaluation question
  • Next by thread: Re: Evaluation question