Slight differences with C-version

This document lists the differences of the functionalities that can be found on the C-version of the Modules package compared to the Tcl-version. The goal of this document is to reference the features of the C-version that are missing or behave differently on the Tcl-version. These information help to clearly know what functionalities was there on C-version that will change in case of migration to the Tcl-version.

This document does not cover the features of the Tcl-version that are not available on the C-version (like collection management, Fish or Tcl shell support, etc). Please refer to the module(1) and the modulefile(4) man-pages of the Tcl-version to discover all the functionalities provided by the Tcl-version of the Modules package.

Package Initialization

Tcl-version does not support cmake and ruby as code output.

MODULESBEGINENV environment snapshot functionality is not supported on Tcl-version.

Command line switches

Command line switches relative to a sub-command must be specified on the command line after the sub-command. For instance module --terse list will raise an error on Tcl-version, module list --terse should be used instead.

--force, -f
--human, -h
--verbose, -v
--silent, -s
--create, -c
--icase, -i
--userlvl lvl, -u lvl

These command line switches are not supported on Tcl-version.

Module Sub-Commands

On C-version, paths composing the MODULEPATH environment variable may contain reference to environment variable. These variable references are resolved dynamically when MODULEPATH is looked at during module sub-command action like avail.


These module sub-commands are not supported on Tcl-version.


On C-version, only the shell aliases defined by the currently loaded modulefiles are set again on a refresh command. Whereas on Tcl-version this command is an alias on the reload command that unload then load all the currently loaded modulefiles.


C-version redirects output made on stdout in ModulesHelp Tcl procedure to stderr.

During an help sub-command, only the ModulesHelp Tcl procedure of a modulefile is interpreted on C-version. Tcl-version interprets all the content of the modulefile, then call the ModulesHelp procedure if it exists.


On Tcl-version the value of an environment variable is set even if the new value is the same as the current value of this variable in environment.


When switching on Tcl-version an old modulefile by a new one, no error is raised if old modulefile is not currently loaded.

When switching on Tcl-version an old modulefile by a new one, this new modulefile does not keep the position that the old modulefile had in the LOADEDMODULES list as done on C-version but it is appended to the end of the list. Same goes for PATH-like environment variables: replaced PATH component is appended to the end or prepended to the beginning of the relative PATH-like variable, not appended or prepended relatively to the position hold by the swapped PATH component.

Modules Specific Tcl Commands


On Tcl-version code passed to the exit Modules specific Tcl command will not be thrown to be the module return value.

module-info flags
module-info trace
module-info tracepat
module-info user

These module-info options are related to C-version specific features so they are available on Tcl-version but with a dummy implementation that always returns false or an empty value.

module-info mode

During an unload sub-command, unload is returned instead of remove. However if mode is tested against remove value, true will be returned.

During a switch sub-command, unload then load is returned instead of switch1 then switch2 then switch3. However if mode is tested against switch value, true will be returned.


These Modules specific Tcl commands are related to C-version specific features so they are available on Tcl-version but with a dummy implementation that always displays a warning message saying the command is not implemented.


When multiple words are passed as argument to module-whatis but they are not enclosed in double-quotes or curly braces they will be displayed as a single line on Tcl-version whereas C-version displays them as one line per word.