SetAttributes
✖
SetAttributes
adds attr to the attributes of the symbol named "symbol" if it exists.
Details

- SetAttributes modifies Attributes[s].
- SetAttributes has attribute HoldFirst.
- SetAttributes does not affect symbols with the attribute Locked.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (3)Survey of the scope of standard use cases
Add an attribute to the list of attributes of a symbol:

https://wolfram.com/xid/09a72k8j2-wbeh0
Add more attributes; the previous ones are retained:

https://wolfram.com/xid/09a72k8j2-cnk69g

https://wolfram.com/xid/09a72k8j2-iz45qt


https://wolfram.com/xid/09a72k8j2-fi0gb2
Add the same attributes to several symbols:

https://wolfram.com/xid/09a72k8j2-gdk1qx
Properties & Relations (6)Properties of the function, and connections to other functions
Set a single attribute for the symbols f and g:

https://wolfram.com/xid/09a72k8j2-cy3pkq
SetAttributes adds to the already existing attributes; Attributes[g]={..} resets the list:

https://wolfram.com/xid/09a72k8j2-op4s

https://wolfram.com/xid/09a72k8j2-b5jt53

SetAttributes is equivalent to this assignment to the attributes:

https://wolfram.com/xid/09a72k8j2-si5wo

Use ClearAttributes to clear a particular attribute:

https://wolfram.com/xid/09a72k8j2-eu9gi

https://wolfram.com/xid/09a72k8j2-eck7li

https://wolfram.com/xid/09a72k8j2-eljr6j

Protecting a symbol is equivalent to setting the Protected attribute:

https://wolfram.com/xid/09a72k8j2-kr2p40

https://wolfram.com/xid/09a72k8j2-ieyx3j

You can still change the attributes of a protected symbol:

https://wolfram.com/xid/09a72k8j2-chwerp
After setting the attribute Locked, no more changes to the attributes can be made:

https://wolfram.com/xid/09a72k8j2-ir23xj
A locked symbol can no longer be unprotected, as the Protected attribute cannot be cleared:

https://wolfram.com/xid/09a72k8j2-b5fvs4


SetAttributes has the attribute HoldFirst:

https://wolfram.com/xid/09a72k8j2-exsfz6


https://wolfram.com/xid/09a72k8j2-ec5ui
This sets attributes of the symbol syms itself:

https://wolfram.com/xid/09a72k8j2-b4zmpq

https://wolfram.com/xid/09a72k8j2-g4fwzb

This sets the attributes of all symbols in the list syms:

https://wolfram.com/xid/09a72k8j2-eef4zu

https://wolfram.com/xid/09a72k8j2-cv2icv

Wolfram Research (1988), SetAttributes, Wolfram Language function, https://reference.wolfram.com/language/ref/SetAttributes.html.
Text
Wolfram Research (1988), SetAttributes, Wolfram Language function, https://reference.wolfram.com/language/ref/SetAttributes.html.
Wolfram Research (1988), SetAttributes, Wolfram Language function, https://reference.wolfram.com/language/ref/SetAttributes.html.
CMS
Wolfram Language. 1988. "SetAttributes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SetAttributes.html.
Wolfram Language. 1988. "SetAttributes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SetAttributes.html.
APA
Wolfram Language. (1988). SetAttributes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetAttributes.html
Wolfram Language. (1988). SetAttributes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetAttributes.html
BibTeX
@misc{reference.wolfram_2025_setattributes, author="Wolfram Research", title="{SetAttributes}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/SetAttributes.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_setattributes, organization={Wolfram Research}, title={SetAttributes}, year={1988}, url={https://reference.wolfram.com/language/ref/SetAttributes.html}, note=[Accessed: 29-March-2025
]}