TYPE
object
hidden abstract type objectParent of all object types. An object is a singleton data structure that resides in the SQL database.
Objects are much like entities, with the following restrictions:
- only a single instance is allowed for each definition
- all object attributes must have default values
- object values cannot be created or deleted from code (they are automatically created during blockchain initialization)
Example definition:
Rell
object state {
mutable x: integer = 0;
mutable s: text = 'n/a';
}Object attributes are accessed directly:
Rell
print(state.x);
print(state.s);Object values can be modified directly, or with an update statement:
Rell
// Direct modification
state.x += 10;
state.s = 'Updated';
// Modification via update statement
update state ( x += 5, s = 'Updated' );See Also
Since 0.7.0