Function parameters and arguments
In our sample function definition given by the following code (Ch3_1.fsx
):
let circleArea radius = System.Math.PI * radius * radius
The radius
identifier represents the function parameter, that is, the name for a value that is expected to be transformed by the function. The value supplied for the parameter upon the function use represents the function argument, as shown when we apply our function in the following code line:
circleArea 15.0
15.0
is the function's argument in the preceding line.
The tuples preview
At this point, in order to reveal the further details about function parameters, a certain notion would be required, which logically belongs to a completely different language facility, specifically to data types. I'm talking about tuples. As it doesn't seem feasible to build an ideally straight storyline, I will provide a necessary preview here and then revisit the subject of tuples in later chapters.
A tuple (https://msdn.microsoft...