attributes
return the attributes
setattribute
assign attributes
Calling Sequence
Parameters
Description
Thread Safety
Examples
attributes(e)
setattribute(e, a)
e
-
expression
a
(optional) attribute
The setattribute(e, a) calling sequence returns a copy of the expression e with attribute a assigned. If the expression, e, is a symbol or string, it is also modified in-place. For other data types, the original expression is unchanged.
Calling setattribute without parameter a removes all attributes from expression e.
Attributes of an expression can be queried by using attributes(e).
All Maple expressions are valid attributes. In particular, expression sequences can be used to assign multiple attributes to an object.
An expression with attributes (other than the NULL expression sequence) is said to be attributed. (See type/attributed.)
Attributes can be assigned to only a name, string, list, set, Array, Matrix, Vector, equation, procedure, unevaluated function call, or a float.
Attributes on rtables can also be set and queried by using the appropriate ArrayOptions, MatrixOptions, or VectorOptions (or generically, rtable_options) command.
The attributes and setattributes commands are thread safe as of Maple 15, provided that the expression e is not shared between threads.
For more information on thread safety, see index/threadsafe.
Set attributes and query the attributes of an expression.
attributes⁡a
setattribute⁡a,blue
blue
setattribute⁡a,yellow,green
yellow,green
Remove all attributes from the expression a.
setattribute⁡a
setattribute⁡s,sin⁡π4
s
attributes⁡s
22
F≔setattribute⁡g⁡2,a banana
F≔g⁡2
A≔attributes⁡g⁡2
B≔attributes⁡F
B≔a banana
H≔setattribute⁡t,2,3,4
H≔t
attributes⁡H
2,3,4
setattribute⁡x1,y=5⁢x+3
x1
attributes⁡x1
y=5⁢x+3
See Also
Array
float
list
Matrix
procedure
set
type/attributed
Vector
Download Help Document