This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Attributes  /
SetAttributes

  • SetAttributes[ s , attr ] adds attr to the list of attributes of the symbol s.
  • SetAttributes modifies Attributes[ s ].
  • SetAttributes[ s , , , ... ] sets several attributes at a time.
  • SetAttributes[ , , ... , attrs ] sets attributes of several symbols at a time.
  • SetAttributes has the attribute HoldFirst.
  • See the Mathematica book: Section 2.3.7Section 2.5.3.
  • See also: ClearAttributes, Protect.

    Further Examples

    The built-in function Log is automatically applied to each element of the list, but the symbol fff is not.

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    Setting the Listable attribute makes fff listable from now on.

    In[3]:=

    In[4]:=

    Out[4]=

    To restore the previous behavior of fff, use ClearAttributes.

    In[5]:=

    In[6]:=

    Out[6]=