A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://reference.wolfram.com/language/tutorial/Evaluation.html below:

Evaluation—Wolfram Documentation

WOLFRAM Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

WolframConsulting.com

The Standard Evaluation Sequence The following is the sequence of steps that the Wolfram Language follows in evaluating an expression like h[e1,e2]. Every time the expression changes, the Wolfram Language effectively starts the evaluation sequence over again. Nonstandard Argument Evaluation There are a number of builtin Wolfram Language functions that evaluate their arguments in special ways. The control structure While is an example. The symbol While has the attribute HoldAll. As a result, the arguments of While are not evaluated as part of the standard evaluation process. Instead, the internal code for While evaluates the arguments in a special way. In the case of While, the code evaluates the arguments repeatedly, so as to implement a loop. Control structures arguments evaluated in a sequence determined by control flow (e.g. CompoundExpression ) Conditionals arguments evaluated only when they correspond to branches that are taken (e.g. If , Which ) Logical operations arguments evaluated only when they are needed in determining the logical result (e.g. And , Or ) Iteration functions first argument evaluated for each step in the iteration (e.g. Do , Sum , Plot ) Tracing functions form never evaluated (e.g. Trace ) Assignments first argument only partially evaluated (e.g. Set , AddTo ) Pure functions function body not evaluated (e.g. Function ) Scoping constructs variable specifications not evaluated (e.g. Module , Block ) Holding functions argument maintained in unevaluated form (e.g. Hold , HoldPattern ) Builtin functions that evaluate their arguments in special ways. Logical Operations The Or function works much like And; it returns True as soon as it finds any argument that is True. Xor, on the other hand, always evaluates all its arguments. Iteration Functions An iteration function such as Do[f,{i,imin,imax}] is evaluated as follows: If there are several iteration variables, the same procedure is followed for each variable in turn, for every value of all the preceding variables. Unless otherwise specified, f is not evaluated until a specific value has been assigned to i, and is then evaluated for each value of i chosen. You can use Evaluate[f] to make f be evaluated immediately, rather than only after a specific value has been assigned to i. Assignments The lefthand sides of assignments are only partially evaluated. The righthand side is evaluated for immediate (=), but not for delayed (:=), assignments. Any subexpression of the form HoldPattern[expr] that appears on the lefthand side of an assignment is not evaluated. When the subexpression is used for pattern matching, it matches as though it were expr without the HoldPattern. Overriding Nonstandard Argument Evaluation Overriding holding of arguments. By using Evaluate, you can get any argument of a function evaluated immediately, even if the argument would usually be evaluated later under the control of the function. An exception to this is when the function has the HoldAllComplete attribute; in this case, the contents of the function are not modified by the evaluator. The Wolfram Language provides various functions which act as "wrappers" to prevent the expressions they contain from being evaluated. Wrappers that prevent expressions from being evaluated. Global Control of Evaluation In the evaluation procedure described so far, two basic kinds of steps are involved: Iteration leads to evaluation chains in which successive expressions are obtained by the application of various transformation rules. Trace shows evaluation chains as lists, and shows subsidiary evaluations corresponding to recursion in sublists. The expressions associated with the sequence of subsidiary evaluations which lead to an expression currently being evaluated are given in the list returned by Stack[]. Global variables controlling the evaluation of expressions. You can ask the Wolfram Language to abort at any point in a computation, either by calling the function Abort[], or by typing appropriate interrupt keys. When asked to abort, the Wolfram Language will terminate the computation as quickly as possible. If the answer obtained would be incorrect or incomplete, then the Wolfram Language returns $Aborted instead of giving that answer. Aborts can be caught using CheckAbort, and can be postponed using AbortProtect.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4