Understanding parameters handling in Bosque
Parameters in Bosque are not a big surprise for any programmer who has used some of the popular programming languages. The majority (or even all) of the examples in the chapter will look very familiar if you have used languages such as JavaScript, TypeScript, or even Java and others. This is why we will go through this topic pretty quickly.
The first thing to note is that all parameters must have a declared type. If you don't provide the type of a parameter, a compile-time error will be thrown. We can't expect auto type detecting to work here.
A simple example of providing and accessing a parameter in a function looks like the following:
function addOne(num: Int): Int { return num + 1; }
As discussed in Chapter 5, Types and Operators, we define a parameter by providing its name followed by a colon and its type. We can access a parameter using its name. In the previous example, we have defined...