This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Attributes

Attributes[symbol]
gives the list of attributes for a symbol.
  • The attributes of a symbol can be set by assigning a value to Attributes[s]. If a single attribute is assigned, it need not be in a list.
  • Attributes[s]={} clears all attributes of a symbol.
  • Attributes gives a list of the attributes for each of the .
  • Attributes for functions must be set before any definitions that involve the functions are given.
  • The complete list of possible attributes for a symbol f is:
Constantall derivatives of f are zero
Flatf is associative
HoldAllall the arguments of f are not evaluated
HoldAllCompletethe arguments of f are completely shielded from evaluation
HoldFirstthe first argument of f is not evaluated
HoldRestall but the first argument of f are not evaluated
Listablef is automatically "threaded" over lists
Lockedattributes of f cannot be changed
NHoldAllthe arguments of f are not affected by N
NHoldFirstthe first argument of f is not affected by N
NHoldRestall but the first argument of f are not affected by N
NumericFunctionthe value of f is assumed to be a number when its arguments are numbers
OneIdentity, , etc. are equivalent to a in pattern matching
Orderlessf is commutative
Protectedvalues of f cannot be changed
ReadProtectedvalues of f cannot be read
SequenceHoldSequence objects in the arguments of f are not flattened out
StubNeeds is automatically called if the symbol is ever input
Temporaryf is a local variable, removed when no longer used
Attributes for an existing symbol:
Set attributes for a new symbol:
Attributes for an existing symbol:
In[1]:=
Click for copyable input
Out[1]=
 
Set attributes for a new symbol:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Attributes of a symbol:
Attributes of several symbols in a list:
The symbol can be given as a string:
Add a single attribute to the symbols and :
SetAttributes adds to the already existing attributes; Attributes[g]={..} resets the list:
An assignment to Attributes is associated with , not with Attributes:
Protecting a symbol is equivalent to setting the Protected attribute:
Attributes has the attribute HoldAll:
This gives the attributes of the symbol itself:
This gives the attributes of all symbols in the list :
New in 1 | Last modified in 3