Definition Attributes
While a definition like cube[x_] = x^3
gives a way to specify values of a function, attributes allow a way to specify general properties of functions and symbols. This is independent of the parameters they take and the values they produce.
The builtin-attributes having a predefined meaning in Mathics3 which are described below.
However in contrast to Mathematica®, you can set any symbol as an attribute.
- Attributes — find the attributes of a symbol
- ClearAttributes — clear the attributes of a symbol
- Constant — treat as a constant in differentiation, etc
- Flat — attribute for associative symbols
- HoldAll — attribute for symbols that keep unevaluated all their elements
- HoldAllComplete — attribute for symbols that keep unevaluated all their elements, and discards upvalues
- HoldFirst — attribute for symbols that keep unevaluated their first element
- HoldRest — attribute for symbols that keep unevaluated all but their first element
- Listable — automatically thread over lists appearing in arguments
- Locked — keep all attributes locked (settable but not clearable)
- NHoldAll — prevent numerical evaluation of elements
- NHoldFirst — prevent numerical evaluation of the first element
- NHoldRest — prevent numerical evaluation of all but the first element
- NumericFunction — treat as a numeric function
- OneIdentity — attribute for idempotent symbols
- Orderless — attribute for commutative symbols
- Protect — protect a symbol against redefinitions
- Protected — attribute of protected symbols
- ReadProtected — attribute of symbols with hidden definitions
- SequenceHold — attribute for symbols that do not expand sequences
- SetAttributes — set attributes for a symbol
- Unprotect — remove protection against redefinitions