SetAttributes
Turns on one of the Wolfram-named properties Attributes can report.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
SetAttributes!SetAttributes(f, attr)Turns on for 's operator definition, in place.SetAttributes(f, {attr1, attr2, ...})Turns on several attributes at once.Typed signatures
| Type | Package | Applies |
|---|---|---|
(symbol, any) -> any | combinatorics | always |
Details
- Only can actually be turned on — see Attributes for why those four and no others. Declines (stays unevaluated) for an undeclared , or any attribute name outside that set, rather than silently accepting a change that didn't happen.
- A declared head is
Protected:SetAttributesleaves the call unevaluated and saysSetAttributes::write(Tag f in f is Protected.), where Wolfram, whoseProtectedguards definitions rather than attributes, makes the change. Only a symbol of your own, defined first, takes attributes. - Always returns , like Wolfram's own .
Examples
Basic #
define a head of your own, turn Orderless on, then read it back with Attributes
live ↗InOut
Wolfram needs no definition before a symbol takes attributes; here the head is defined first, since SetAttributes leaves an undeclared symbol alone.
About
| Examples | 3 |
|---|---|
| Checked against | Wolfram Language 2 differ |
| Crosswalk | Wolfram Language |
See also: Attributes, ClearAttributes