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



Nathan Baum wrote:
> Jon Harrop wrote:
>> Nathan Baum wrote:
>>>You misunderstand me. I mean that the Mathematica equivalent of 'X,
>>>which I suppose is just (X), would behave that way.
>>
>> I don't understand. The Mathematica equivalent of 'X is Hold[X]?
>
> No. Because Mathematica has a wildly different evaluation model, its
> equivalent of 'X is simply (X) -- Mathematica keeps evaluating until an
> expression doesn't change. 'X changes when it is evaluated, and
> therefore, from Mathematica's point of view, 'X is equivalent to (X).

I think this is an important point: all Mathematica values are equivalent to
Lisp s-exprs. So all Mathematica equivalents must be quoted at least once.
So (X) cannot be a Lisp equivalent of anything in Mathematica, AFAIK.

>> Note that this has nothing to do with the similarity between QUOTE and
>> Hold. This is entirely to do with evaluation semantics, which are
>> definitely not the same.
>
> How do you propose to judge the similarity of QUOTE and Hold _without_
> considering how they effect the evaluation of expressions?

I'm just comparing the effect of eval on QUOTE and Release on Hold. I'm not
trying to say that the subsequent evaluation of the enclosing expression
works in the same way.

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



Relevant Pages

  • Fundamentals of the Mathematica Programming Language note set by Richard J. Gaylord available
    ... to give you a flavor of what i am trying to emphasize in the note set, ... Mathematica Programming Fundamentals: ... When the lhs of a rewrite ... Evaluation then proceeds by searching for further matching ...
    (sci.math.symbolic)
  • Re: Very poor Lisp performance / about Mathematica
    ... his personal experience interacting with Mathematica. ... assume that Jon has the language design and semantics experience to ... , the order of evaluation is not specified, but the ... > Just as you use quote in a Lisp macro. ...
    (comp.lang.lisp)
  • Re: Very poor Lisp performance / about Mathematica
    ... > The site uses Mathematica to do its math. ... backquote and comma in CLTL. ... So,,@q means ``the value of q is a list of forms; splice the list ... available at the time of second evaluation, that is, when the ...
    (comp.lang.lisp)
  • Re: Where comes the myth that Lisp is interpreted?!
    ... operations of Mathematica in OCaml. ... A.4.1 The Standard Evaluation Sequence ... Unless h has attribute HoldAllComplete strip the outermost of any ...
    (comp.lang.lisp)
  • Re: Lisps QUOTE and Mathematicas "Hold"
    ... >> You can see Hold in Mathematica but not QUOTE in Lisp but isn't that more ... At least in Lisp case, the QUOTE form was evaluated and it ... However, despite the difference in method of evaluation, the results are ...
    (comp.lang.lisp)