Previous: , Up: Mmc arguments   [Contents][Index]


2.1.3 File name and module name arguments

In the absence of the --make option, non-option arguments can be either file names (if they end in ‘.m’) or module names (if they don’t).

The compiler converts module names to file names in one of two ways. In the absence of a file named Mercury.modules in the current directory, it relies on each module being stored in a file whose name is just the module name followed by ‘.m’. For example, given a module named e.g. foo.bar.baz, the compiler expects to find it in foo.bar.baz.m.

If any module of the program does not meet this expectation, then the user must create a Mercury.modules file, which contains a map from module names to file names. This can be created using a command such as mmc -f *.m if all the modules of the program are in the current directory (see Options that give the compiler its overall task). In the presence of the Mercury.modules file, the compiler will of course get the file name corresponding to a module name by looking up the module name in this file.