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 ...
Get F# 4.0 Design Patterns now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.