HoldFirst

HoldFirst

is an attribute that specifies that the first argument to a function is to be maintained in an unevaluated form.

Examples

open allclose all

Basic Examples  (1)

Applications  (1)

Definitions for unevaluated expressions can implement call-by-name semantics:

The global variable has been modified:

Properties & Relations  (6)

Functions that operate on symbols often need the HoldFirst attribute:

Assignments do not evaluate their left-hand sides:

Use Evaluate to force evaluation of an argument of a HoldFirst function:

Suppress the evaluation of the first argument of a pure function:

Sequence splitting still happens for HoldFirst functions:

NHoldFirst protects arguments from N but evaluates them normally otherwise:

Introduced in 1988
 (1.0)