Identifying access operators
In this section, we will discuss three types of access operators – tuple typed, record typed, and nominal typed. These operators are a very convenient way of retrieving data from various data structures. We will go through them one by one. Let's get started.
The tuple typed access operator
This feature is pretty similar to what was described in Chapter 3, Bosque Key Features, in the Bulk algebraic data operations section. We will review this in more detail based on our web push notification-sending app example.
So, imagine that in our source file where we get our user data from the user properties are provided in a different order than you expect them to appear in the sendPush
function. After parsing and splitting a single line, you get this kind of tuple:
let user = ["faketoken", "Warsaw", 24, "Doe", "John", "Bird"];
So first, we have a token, then a city, age, last name, and...