Implementation module
ID: implementation-module
An implementation module supplies the executable procedures and private declarations behind a Modula-2 module interface. Its associated definition module determines which declarations clients may import. This separation lets clients depend on an interface while the implementation selects a representation.
For example, a counter module can export a procedure
Next while storing a private running count. Its implementation module defines how Next updates and returns that count; clients need not know the private variable's name. Replacing the storage mechanism is possible when the exported behavior remains compatible. The GNU Modula-2 manual illustrates separate definition and implementation source files, then compiles implementation modules before linking them into a software library.[ref]Building a shared library in the GNU Modula-2 documentation. §2.14, a.def/a.mod and compilation/linking example
New to topics? Read the docs here!