"Value" (Data Structure)
"Value"
represents a mutable expression value.
Details
- A mutable value can be modified in any part of a program:
-
CreateDataStructure["Value",x] create a new "Value" with specified initial value x Typed[x,"Value"] give x the type "Value" - For a data structure of type "Value", the following operations can be used:
-
ds["Copy"] return a copy of ds time: O(1) ds["Get"] get the value stored in ds time: O(1) ds["Set",x] set the value of ds to x time: O(1) ds["Visualization"] return a visualization of ds time: O(1) - The following functions are also supported:
-
dsi===dsj True, if dsi equals dsj FullForm[ds] the full form of ds Information[ds] information about ds InputForm[ds] the input form of ds Normal[ds] convert ds to a normal expression
Examples
open allclose allBasic Examples (1)
A new "Value" can be created with CreateDataStructure:
Insert a new value to be stored:
Confirm that the value has updated:
Scope (2)
Mutability (1)
Information (1)
A new "Value" can be created with CreateDataStructure: