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:

Wolfram Research (1988), HoldFirst, Wolfram Language function, https://reference.wolfram.com/language/ref/HoldFirst.html.

Text

Wolfram Research (1988), HoldFirst, Wolfram Language function, https://reference.wolfram.com/language/ref/HoldFirst.html.

BibTeX

@misc{reference.wolfram_2020_holdfirst, author="Wolfram Research", title="{HoldFirst}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/HoldFirst.html}", note=[Accessed: 21-January-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_holdfirst, organization={Wolfram Research}, title={HoldFirst}, year={1988}, url={https://reference.wolfram.com/language/ref/HoldFirst.html}, note=[Accessed: 21-January-2021 ]}

CMS

Wolfram Language. 1988. "HoldFirst." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HoldFirst.html.

APA

Wolfram Language. (1988). HoldFirst. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HoldFirst.html