Mathematica 9 is now available

Attributes

Usage

Attributes[symbol]给出一个符号的属性列表.


Notes

• 一个符号的属性可以通过对 Attributes[s]赋值来设定.如果是一个单独的属性被赋值的话,该属性不必在一个列表中.
Attributes[s] =   清除一个符号的所有属性.
Attributes[  ,  , ...  ] 给出由每个  所具有的属性构成的列表.
Attributes["str"] 给出一个由所有与字符串模式匹配的符号所具有的属性构成的列表.
Attributes[HoldPattern[s]] 被处理为与 Attributes[s]是等价的.
• 函数的属性必须在任何包含该函数的定义之前设定. • 一个符号 f 的可能属性的完整列表是:
"\!\(\*StyleBox[\"\\\"Constant\\\"\", \"MR\"]\) " f 的所有导数为0
"\!\(\*StyleBox[\"\\\"Flat\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"f\\\"\", \"TI\"]\) is associative "
f 是组合的
"\!\(\*StyleBox[\"\\\"HoldAll\\\"\", \"MR\"]\) " f 的所有参数都不参与运算
"\!\(\*StyleBox[\"\\\"HoldAllComplete\\\"\", \"MR\"]\) " f 的参数完全与运算隔离
"\!\(\*StyleBox[\"\\\"HoldFirst\\\"\", \"MR\"]\) " f 的第一个参数不参与运算
"\!\(\*StyleBox[\"\\\"HoldRest\\\"\", \"MR\"]\) "除第一个参数外的 f 的其它参数不参与运算
"\!\(\*StyleBox[\"\\\"Listable\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"f\\\"\", \"TI\"]\) is automatically "threaded" over lists "
f自动线形作用于整个列表
"\!\(\*StyleBox[\"\\\"Locked\\\"\", \"MR\"]\) " f 的属性不能被更改
"\!\(\*StyleBox[\"\\\"NHoldAll\\\"\", \"MR\"]\) " f 的参数不受 N 的影响
"\!\(\*StyleBox[\"\\\"NHoldFirst\\\"\", \"MR\"]\) " f 的第一个参数不受 N 的影响
"\!\(\*StyleBox[\"\\\"NHoldRest\\\"\", \"MR\"]\) "除第一个参数外的 f 的其它参数不受 N 的影响
"\!\(\*StyleBox[\"\\\"NumericFunction\\\"\", \"MR\"]\) """参数是数时, f 的值也假定为一个数
"\!\(\*StyleBox[\"\\\"OneIdentity\\\"\", \"MR\"]\) " f [a], f [ f [a]]等在模型匹配中与 a 等价
"\!\(\*StyleBox[\"\\\"Orderless\\\"\", \"MR\"]\) " f 可交换
"\!\(\*StyleBox[\"\\\"Protected\\\"\", \"MR\"]\) " f 的值不能被改变
"\!\(\*StyleBox[\"\\\"ReadProtected\\\"\", \"MR\"]\) " f 的值不能被读出
"\!\(\*StyleBox[\"\\\"SequenceHold\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Sequence\\\"\", \"MR\"]\) objects in the arguments of \!\(\*StyleBox[\"\\\"f\\\"\", \"TI\"]\) are not flattened out "
f 的参数中的序列对象不被压平.
"\!\(\*StyleBox[\"\\\"Stub\\\"\", \"MR\"]\) "若符号从曾经是输入,则自动被调用.
"\!\(\*StyleBox[\"\\\"Temporary\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"f\\\"\", \"TI\"]\) is a local variable, removed when no longer used "
f 是局部变量,当不再使用时就去掉.
• 参见 Mathematica 全书: 2.3.7节 和 2.5.3节.
• 同时参见: SetAttributes, ClearAttributes.
Further Examples

This gives the attributes of the Plus function.

In[1]:=  

Out[1]=

Here are the attributes of Log and of Integrate.

In[2]:=  

Out[2]=



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.