Evaluate

Evaluate[expr]

causes expr to be evaluated even if it appears as the argument of a function whose attributes specify that it should be held unevaluated.

Details

  • You can use Evaluate to override HoldFirst etc. attributes of builtin functions.
  • Evaluate only overrides HoldFirst etc. attributes when it appears directly as the head of the function argument that would otherwise be held. »

Examples

open allclose all

Basic Examples  (1)

Evaluate inside a Hold:

Scope  (1)

Evaluate works for arguments of any symbol with attributes HoldAll, HoldFirst, or HoldRest:

Since Attributes is HoldAll, use Evaluate to find the properties of the value of x:

Applications  (3)

Unprotect a system symbol to make a definition for it:

Restore protection:

Force evaluation of the right-hand side of a delayed definition:

Build a function from an expression:

Properties & Relations  (3)

Evaluate does not work inside functions with attribute HoldAllComplete:

Use Unevaluated to temporarily treat a function as if it were HoldAll:

Evaluate does not work inside Unevaluated:

Possible Issues  (1)

Evaluate works only on the first level, directly inside a held function:

Introduced in 1991
 (2.0)