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

Clear

Usage

Clear[ ,  , ... ] 清除 的值和定义.
Clear[" ", " ", ... ] 清除所有的其名字匹配任何字符串模式 的符号的值和定义.


Notes

Clear 并不清除与符号关联的属性,信息或缺省设置.
Clear["form"]允许在节A.3.13中指定的诸如*通配符.
Clear["context`*"]清除在特殊上下文中的所有符号.
Clear 具有属性 HoldAll.
Clear 并不对有属性Protected的符号发生影响.
• 参见Mathematica全书: 1.2.2, 节 1.7.1, 节 2.4.3, 节 2.6.12 and 节 A.5.4.
• 同时参见: Remove.
Further Examples

Various rules and values are associated with h1.

In[1]:=  

In[2]:=  

Out[2]=

In[3]:=  

Here are the rules in action.

In[4]:=  

Out[4]=

Clear gets rid of values and definitions from h1.

In[5]:=  

The Listable attribute is left alone by Clear. To get rid of values alone use Unset; to get rid of everything use ClearAll; to get rid of everything including the symbol h1 itself use Remove.

In[6]:=  

Out[6]=