Introducing modules
Modules in V allow you to logically group related blocks or pieces of functionality. The concept of modules offers you the ability to structure the code base and makes the code look well organized and easily identifiable. Let's begin learning about the modular approach in V by looking at the syntax to define and import the module. We will also learn how to create a module with public functions and access them from outside the module.
The syntax to define a module
V allows you to define a module using the module
keyword followed by the name of the module. The following code specifies the syntax of how to define a module:
module MY_MODULE
In the preceding syntax, MY_MODULE
can be any name that signifies the functionality that is present inside the module. The module naming convention is similar to that of variables, as detailed in the Variable naming convention section of Chapter 3, Variables, Constants, and Code Comments.