scalar tag
Persistent logic tag
Stores a single value.
Sample usage
<score:scalar 0> creates a scalar named score, holding 0.
<s:scalar {ab}, {cde}> stores the single value {abcde}.
<score | add score, 1> adds one to score.
Fields
Primary field
Scalar field
The stored value. If several values are given, they are joined together into one.
Secondary fields
- onSet: (code field) carried out when a new value is assigned.
- onGet: (code field) carried out when the value is read. If onGet is defined, whatever its code generates is used as the value read, instead of the stored value. See onGet field.
Behaviour
A scalar creates an invisible tag instance that holds one value until it is changed or the scalar is removed.
- Operators: .# and .@ work on the characters of a text value. .& generates a reference pointer to the scalar. If the scalar holds a reference pointer, .* follows it. See Reference Pointers.
- Naming a transient logic tag or field expression may create a scalar automatically. See Tag and Field Categories.
See also