Learning about scoped access and invocations
Similar to the previous topic, this one will also not be of any surprise to anyone who has experience with other object-oriented programming languages. Most of the features presented here will probably look very familiar but there is one feature that is unique to Bosque – conjunction type scoped access and invocations.
We will quickly go through this topic while taking a closer look at the unique feature. Firstly, we will see how variable scoped access works, and then we will have a look at scoped invocations.
Understanding variable scoped access
Let's start with the most common thing, which is a local variable or parameter. As mentioned in the Understanding parameters handling in Bosque section, we access them using their name. So, if we have a function with a usersCount
parameter, we can access it like this:
let approxRevenue = usersCount * 10;
Simple as that. The same is done with local variables – the...