Re: Evaluation details
- To: mathgroup at smc.vnet.net
 - Subject: [mg86742] Re: [mg86722] Evaluation details
 - From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
 - Date: Thu, 20 Mar 2008 02:52:04 -0500 (EST)
 - References: <200803191026.FAA05164@smc.vnet.net>
 
On 19 Mar 2008, at 11:26, Mumbo Jumbo wrote:
> Hello,
>
> I am quite puzzled why a Mathematica statement
> x=x+1;
> causes infinite recursion. Since the ducumentation states that the  
> lhs of
> this statement is not evaluated, it seems to me that the evaluation  
> of the
> rhs should not lead to recursive evaluation.
> TIA, Yuri.
>
>
The left hand side is not "pre-evaluated" but an OwnValue for x is  
created:
In[3]:= Block[{$RecursionLimit = 20}, x = x + 1]
"reclim" : "Recursion depth of   20 exceeded."
Out[3]= Hold[x + 1] + 19
In[4]:= OwnValues[x]
Out[4]= {HoldPattern[x] :> Hold[x + 1] + 19}
and then the rhs is evaluated, this OwnValue applied, a new OwnValue  
for x created etc.
Andrzej Kozlowski
- References:
- Evaluation details
- From: "Mumbo Jumbo" <mjumbo@gmail.com>
 
 
 - Evaluation details