Re: Lisp's QUOTE and Mathematica's "Hold"



Nathan Baum wrote:
> This distinction is very significant, because QUOTE only 'protects'
> against one round of evaluation.
>
> (EVAL A) => <the result of evaluating the value of A>
> (EVAL 'A) => <the value of A>
> (EVAL ''A) => A
>
> In a hypothetical Mathematica-like dialect of Lisp,
>
> A => <the value of A>
> 'A => <the value of A>
> ''A => <the value of A>
> (EVAL A) => <the value of A>
> (EVAL 'A) => <the value of A>
> (EVAL ''A) => <the value of A>

No:

In[15]:= a=3

Out[15]= 3

In[16]:= a

Out[16]= 3

In[17]:= Hold[a]

Out[17]= Hold[a]

In[18]:= Release[Hold[a]]

Out[18]= 3

In[19]:= Release[Hold[Hold[a]]]

Out[19]= Hold[a]

So Hold "protects against one round" of Release.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages