Operand - modelint/types GitHub Wiki
An Operator may take any number of values. For example, the increment operator on a Counter
User Type takes no Parameters.
In an action language like Scrall we might see:
area.Impacts.inc // increment the value of the Impacts attribute of the area instance
Here we would assume that the Impacts
attribute was typed as Counter
and that the inc
operator was invoked. In this case, no Parameters are required.
Let's say that we want to compute the distance between two Waypoints
.
Again, in Scrall, we might see:
distance = Position - destination.Position
Here we may have typed Position as GPS Coordinate. On GPS Coordinate we define an operator named subtract(Position)
. It takes one un-named Parameter and is associated with a function that computes the distance to that other waypoint.
By overriding the subtract operator with distance computations, we are able to interpret the minus sign as a type specific operator invocation.
Identifiers
- Position + Operator + Type
Attributes
Position
Type: Ordinal("Operand")