Channel operations
In this section, we will learn about the basic operations that we can perform on a channel. First, we will understand the arrow operator, which is identified by the <-
symbol. This represents the flow of data into a channel in V. Then, we will learn about the two basic channel operations, which include pushing a value into the channel and popping the value out of the channel using the arrow operator.
Arrow operator <-
As we mentioned in the introduction to this chapter, a channel in V lets information flow in only one direction, and it is an analogy of a queue. As a rule of thumb, the data in a channel always flows from right to left in V.
The syntactic representation is also consistent in V, and the representation of the data flow is always identified from right to left. Even if we look at the sign of the arrow operator, <-
, it too always points toward the left.
The direction of the arrow operator, <-
, indicates that the values always enter...