"Rule" (Compiled Type)
"Rule"::[tykey,tyvalue]
represents a type with specified types for key and value.
Details
- "Rule" can be used in Typed and related constructs to specify a type.
- "Rule" objects are automatically memory managed.
- The key and value of a "Rule" can have any compiled type.
Constructors
- Rules can be created with Rule (->, ) in compiled code.
Properties
- First[rule] returns the first element of a rule.
- Last[rule] returns the last element of a rule.
- Information[rule,"KeyType"] for rule of type "Rule"::[tykey,tyvalue] gives tykey.
- Information[rule,"ValueType"] for rule of type "Rule"::[tykey,tyvalue] gives tyvalue.
Conversions
- Rule expressions can be converted into compiled code elements with the type "Rule"::[tykey,tyvalue] if the first element can be converted into the type tykey and the last element can be converted into the type tyvalue.
- "Rule" compiled elements can be converted into Rule expressions.
From Expressions
To Expressions
See Also
Related Guides
Related Links
History
Introduced in 2024 (14.1)