Understanding function features
In the previous sections, we learned about various types of functions and discovered how to write basic functions, anonymous functions, and higher-order functions. As a V programmer, it is important to know the various features of functions that will enable you to work with them smoothly while programming. The following is a list of the features of functions in V:
- Functions can return values or simply perform operations.
- Functions can take zero or more input arguments.
- Functions can return multiple values.
- Functions can call other accessible functions.
- Functions allow only arrays, interfaces, maps, pointers, and structs as mutable arguments.
- Function declarations in script mode should come before all script statements.
- Functions do not allow access to module variables or global variables.
- Functions do not allow default or optional arguments.
- Functions can have optional return types.
- Functions are private by...