Connections - The HAC Language
Description: The HAC Language

Next: Attributes, Previous: Templates, Up: Top

## 10 Connections

Connections are a relation between instance references. (Connections are established in the meta-language processing of compilation; they are determined at compile-time only.)

Instance references refer to specific entities at unroll-time. Instance references fall into two categories: implicit and explicit. See Arrays.

What does a = b mean in the namespace or definition context?

- Parameters: the value of b is assigned to a. This is only valid if b is instantiated and initialized, and a is instantiated and uninitialized.
- Datatypes (both built-in and user-defined), channels and processes: a and b refer to the same instance, in other words, they are aliases.

If the types are user-defined, then aliasing is recursive. For example, if the type of a and b has members (either public or private) x and y internally aliased, the a.x, a.y, b.x, and b,y are all valid references to the same instance of x and y's type. (Implementation: This can simply be accomplished by mapping a and b to the same instance, saving the trouble of recursive aliasing, and generating the combinations of names, not that that is ever a problem.)

Since connections and aliases are unrolled, the actual instance objects are not created until all connections have been processed.

Compiler options (proposed to support):

- -Wprocess-alias: warning for connections between process (since the semantics seem arbitrary at this point and are prone to future change),
- -Wchannel-connections: warning for suspicious wrong connections with channels (multiple senders or multiple receivers)

Support for non-alias connections?