Re: Where comes the myth that Lisp is interpreted?!



Rob Thorpe skrev:

Once Jon Harrop wrote an interpreter that performed the important core
operations of Mathematica in OCaml. His version was much, much simpler
than the C version and still quite fast. He showed this to Wolfram
software but they weren't interested in changing their program.

Once you put in the quirks...


A.4.1 The Standard Evaluation Sequence

The following is the sequence of steps that Mathematica follows in evaluating an expression like h[ , , ... ]. Every time the expression changes, Mathematica effectively starts the evaluation sequence over again.

- If the expression is a raw object (e.g., Integer, String, etc.),
leave it unchanged.

- Evaluate the head h of the expression.

- Evaluate each element of the expression in turn. If h is a symbol with
attributes HoldFirst, HoldRest, HoldAll or HoldAllComplete, then skip
evaluation of certain elements.

- Unless h has attribute HoldAllComplete strip the outermost of any
Unevaluated wrappers that appear in the .

- Unless h has attribute SequenceHold, flatten out all Sequence objects
that appear among the .

- If h has attribute Flat, then flatten out all nested expressions with
head h.

- If h has attribute Listable, then thread through any that are lists.

- If h has attribute Orderless, then sort the into order.

- Unless h has attribute HoldAllComplete, use any applicable
transformation rules associated with f that you have defined for
objects of the form h[ f[ , ... ], ... ].

- Use any built-in transformation rules associated with f for objects of
the form h[ f[ , ... ], ... ].

- Use any applicable transformation rules that you have defined for
h[ , , ... ] or for h[ ... ][ ... ].

- Use any built-in transformation rules for h[ , , ... ] or for
h[ ... ][ ... ].


Nice and simple...

But wait! There is more:

A.4.2 Non-Standard Argument Evaluation
A.4.3 Overriding Non-Standard Argument Evaluation
A.4.4 Preventing Evaluation
A.4.5 Global Control of Evaluation
A.4.6 Aborts

<http://documents.wolfram.com/mathematica/TheMathematicaBook/MathematicaReferenceGuide/Evaluation/>

--
Jens Axel Søgaard
.



Relevant Pages

  • Re: Must an expression be evaluated before its value is used?
    ... this is not a sequence point. ... The evaluation dependency has a consequence of ... seperate the assignment of 5 to x from the assignment of 11 to x. ... comma operator without first evaluating it's second operand. ...
    (comp.std.c)
  • 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)
  • Scott & Andrei article on DCLP and threading... Flawed ?
    ... am unable to make a solid case for strict ordering of 1,2 and 3. ... "As we tried to point out in the article, sequence points don't offer ... state of the execution environment. ... There is a sequence point at the completion of evaluation of each ...
    (comp.lang.cpp)
  • Re: Linux X demo
    ... precedence to the order of evaluation. ... evaluation of expressions is undefined. ... THE ORDER OF EVALUATION BETWEEN SEQUENCE POINTS. ...
    (alt.lang.asm)
  • Re: Must an expression be evaluated before its value is used?
    ... properly define the ordering of sequence points. ... The evaluation order is defined by the abstract machine (even if it is ... there is a sequence point after the evaluation of the first operand. ... "2 The left operand of a comma operator is evaluated as a void ...
    (comp.std.c)