Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

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

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

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

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
Evaluation
TECH NOTE

Evaluation

The Standard Evaluation SequencePreventing Evaluation
Nonstandard Argument EvaluationGlobal Control of Evaluation
Overriding Nonstandard Argument EvaluationAborts
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.
  • 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 ei 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 attributes SequenceHold or HoldAllComplete, flatten out all Sequence objects that appear among the ei.
  • Unless h has attribute HoldAllComplete, strip the outermost of any Unevaluated wrappers that appear among the ei.
  • If h has attribute Flat, then flatten out all nested expressions with head h.
  • If h has attribute Listable, then thread through any ei that are lists.
  • If h has attribute Orderless, then sort the ei 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[e1,…],…].
  • Use any built‐in transformation rules associated with f for objects of the form h[f[e1,…],…].
  • Use any applicable transformation rules that you have defined for h[f[e1,e2,…],…] or for h[…][…].
  • Use any built‐in transformation rules for h[e1,e2,…] or for h[…][…].
Nonstandard Argument Evaluation
There are a number of built‐in 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 )
Built‐in functions that evaluate their arguments in special ways.

Logical Operations

In an expression of the form the are evaluated in order. As soon as any is found to be False, evaluation is stopped, and the result False is returned. This means that you can use the to represent different “branches” in a program, with a particular branch being evaluated only if certain conditions are met.
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:
  • The limits imin, imax are evaluated.
  • The value of the iteration variable is made local, effectively using Block.
  • imin and imax are used to determine the sequence of values to be assigned to the iteration variable i.
  • The iteration variable is successively set to each value, and f is evaluated in each case.
  • The local values assigned to i are cleared.
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 left‐hand sides of assignments are only partially evaluated.
  • If the left‐hand side is a symbol, no evaluation is performed.
  • If the left‐hand side is a function without hold attributes, the arguments of the function are evaluated, but the function itself is not evaluated.
The right‐hand side is evaluated for immediate (=), but not for delayed (:=), assignments.
Any subexpression of the form HoldPattern[expr] that appears on the left‐hand 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
f[…,Evaluate[expr],…]
evaluates the argument expr, whether or not f has a HoldFirst, HoldRest, or HoldAll attribute specifying that it should be held
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.
Preventing Evaluation
The Wolfram Language provides various functions which act as "wrappers" to prevent the expressions they contain from being evaluated.
Hold[expr]
treated as Hold[expr] in all cases
HoldComplete[expr]
treated as HoldComplete[expr] with upvalues disabled
HoldForm[expr]
treated as expr for printing
HoldPattern[expr]
treated as expr in rules, definitions and patterns
Unevaluated[expr]
treated as expr when arguments are passed to a function
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: evaluate a particular expression until it no longer changes.
  • Recursion: evaluate subsidiary expressions needed to find the value of a particular expression.
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[].
$RecursionLimit
maximum recursion depth
$IterationLimit
maximum number of iterations
Global variables controlling the evaluation of expressions.
Aborts
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.

Related Guides

    ▪
  • Evaluation Control
Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English