18.2. Location expressions

All reference objects have a unique associated cluster id, the object's location. When a reference object is created by a thread, its location will be the same as the locus of control when the new expression was executed. A reference object is near to a thread if its current location is the same as the thread's locus of control, otherwise it is far.

There are several built-in expressions for location:

Table 18-1.

ExpressionTypeDescription
hereINTThe cluster id of the locus of control of the thread.
where(expression)INTThe location of the argument. If the argument is void or an immutable type, it returns 'here'.
near(expression)BOOLtrue if the argument is on the same cluster as the executing thread. If the argument is void or an immutable type, it returns false.
far(expression)BOOLtrue if the argument is not on the same cluster as the executing thread. If the argument is void or an immutable type, it returns false.
clustersINTNumber of clusters. Although a constant, may not be available at compile time.
clusters!INTIterator which returns all cluster ids in order, 0 through clusters-1.