WOLFRAM

is an attribute that prevents any values associated with a symbol from being modified.

Details

  • Many builtin Wolfram Language functions have the attribute Protected.
  • SetOptions can be used on symbols with attribute Protected that do not also have the Locked attribute.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

String has the attribute Protected:

Out[1]=1

Set the attribute Protected on f:

Out[2]=2

Scope  (1)Survey of the scope of standard use cases

Simultaneously protect and read protect the function f:

f has both attributes:

Out[3]=3

Simultaneously clear both attributes:

Both have been cleared:

Out[5]=5

Applications  (1)Sample problems that can be solved with this function

Unprotect a system symbol to make a definition for it:

Out[1]=1

Restore protection:

Out[3]=3

Properties & Relations  (5)Properties of the function, and connections to other functions

Protecting a symbol is equivalent to setting the Protected attribute:

Out[3]=3

Unprotecting a symbol is equivalent to clearing the Protected attribute:

Out[6]=6

No more definitions can be made for a protected symbol:

Out[3]=3

Neither can definitions be cleared:

To modify definitions of a protected symbol, unprotect it first:

Out[2]=2

SetOptions can be used the change the default options of a protected function:

Out[1]=1

Change the options of D:

Out[2]=2

Restore the system default:

Out[3]=3

A symbol that is locked and protected can no longer be changed:

Out[2]=2
Out[4]=4
Wolfram Research (1988), Protected, Wolfram Language function, https://reference.wolfram.com/language/ref/Protected.html.
Wolfram Research (1988), Protected, Wolfram Language function, https://reference.wolfram.com/language/ref/Protected.html.

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_protected, author="Wolfram Research", title="{Protected}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Protected.html}", note=[Accessed: 09-July-2025 ]}

@misc{reference.wolfram_2025_protected, author="Wolfram Research", title="{Protected}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Protected.html}", note=[Accessed: 09-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_protected, organization={Wolfram Research}, title={Protected}, year={1988}, url={https://reference.wolfram.com/language/ref/Protected.html}, note=[Accessed: 09-July-2025 ]}

@online{reference.wolfram_2025_protected, organization={Wolfram Research}, title={Protected}, year={1988}, url={https://reference.wolfram.com/language/ref/Protected.html}, note=[Accessed: 09-July-2025 ]}