Summary
In this chapter, we clearly understood the concept of modular programming in V. We learned how to create and import modules along with various concepts that help us to work with them. We learned, through code examples, that having modules makes the code that belongs to the project look more accessible and organized. We also learned about the various ways to work with modules, including accessing module members such as structs, functions, and constants.
Additionally, we covered how to work with multiple files inside a module and understood the scope for the members defined inside and outside of a module. Following this, we learned about initializer functions and also understood the implications of creating cyclic imports. Finally, we covered how to access the structs and embedded structs of a module using code examples.
Having understood modules, in the next chapter, we will proceed to explore concurrency in V.