Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
language:types [2022/05/13 12:33] rajitlanguage:types [2025/04/21 14:32] (current) – [Parameterized types] rajit
Line 189: Line 189:
  
  
-===== Parameterized types =====+===== Parameterized built-in types =====
  
 Parameterized types give ACT considerable flexibility in type Parameterized types give ACT considerable flexibility in type
Line 226: Line 226:
 The default data type for a channel is assumed to be the default The default data type for a channel is assumed to be the default
 ''int'', namely ''int<32>''. ''int'', namely ''int<32>''.
 +
 +Channels are almost always unidirectional, with data being transferred from sender to receiver.
 +In a few cases, it is useful to be able to transfer data from the sender to the receiver, and from the
 +receiver to the sender in one channel action. To declare a channel where data are transferred in
 +both directions, use:
 +<code act>
 +// a bool is transferred from sender to receiver, and
 +// an int is transferred from the receiver to the sender
 +chan(bool,int) x;
 +</code>
 +These are sometimes called //exchange channels//, since data is exchanged between the sender and receiver.
 +
  
 Another built-in data type is the //enumeration// type. An Another built-in data type is the //enumeration// type. An