Location expressions

Sather - Language Specification
Prev | Chapter 18. Distributed Extension | Next

# 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.

Expression | Type | Description
--- | --- | ---
here | INT | The cluster id of the locus of control of the thread.
where(expression) | INT | The location of the argument. If the argument is void or an immutable type, it returns 'here'.
near(expression) | BOOL | true 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) | BOOL | true 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.
clusters | INT | Number of clusters. Although a constant, may not be available at compile time.
clusters! | INT | Iterator which returns all cluster ids in order, 0 through clusters-1.

Prev | Home | Next
Distributed Extension | Up | with-near statement