此为 Mathematica 4 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

SetAttributes

Usage

SetAttributes[s, attr]attr 添加到符号 s 的属性列表.


Notes

SetAttributes 修正 Attributes[s].
SetAttributes[s,   ,  , ...  ]一次设置多个属性.
SetAttributes[  ,  , ...  , attrs] 一次设置多个符号的属性.
SetAttributes 具有 HoldFirst 属性.
• 参见Mathematica 全书 : 2.3.7节2.5.3节.
• 同时参见: 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]=