AI Features

Module Imports and the Use of Encapsulation

Get introduced to the protection attributes of module imports and the use of encapsulation.

Module imports are private by default

A module that is imported by import is private to the module that imports it. It would not be visible to other modules that import it indirectly. For example, if a school module imports std.stdio, the modules that further import school cannot automatically use the std.stdio module.

Let’s assume that the school module starts by the following lines:

module
...
Ask