Default and latest version specifiers¶
Configuration¶
Rely on
advanced_version_specoptionNo need for an extra configuration option
When option is on it automatically enables use of these two new version specifiers
When
advanced_version_specis off,mod@latestis considered as a modulefile name to findin case
implicit_defaultis disabledmeans a
defaultsymbol or alatestsymbol should be found defined to respectively make use of the@defaultor@latestspecifiersa not found error is otherwise raised, as specified version does not exist
Specification¶
When a
defaultor alatestsymbol is defined@defaultor respectively@latestwill resolve to the symbol target
When no
defaultorlatestsymbol is defined@defaultand@latestpoint to the highest existing version (also called the implicit default)note that if a
defaultsymbol is defined but not alatestsymbol,@defaultpoints to the defined default and@latestpoints to the highest version that exists
defaultorlatestversion specifiers can be employed:in single version specification:
@defaultor@latestin version list:
@vers1,defaultor@latest,default,vers2
defaultorlatestversion specifiers cannot be employed in version rangeotherwise an error is raised
defaultorlatestversion specifiers can also be specified with the traditionalmod/versionsyntaxfor instance
mod/defaultormod/latest
When a
defaultorlatestmodulefile exists@defaultor respectively@latestwill resolve to the existing modulefileno automatic symbol will be recorded in this case as
defaultorlatestare regular versions
To be included in module search result, the version specifiers should fully match search query or search query should not target a specific module version
the automatically defined symbolic versions are included in results for queries like
mod@latestormodbut not for queries like
mod@la,mod@def,mod@lat*,mod@def??lt
Automatically defined
defaultandlatestversion specifiers are not displayed to avoid overloading output:on
module listoutputon
module availoutputon
module spideroutputthose three sub-commands only display symbolic versions manually defined
Alternative module names deduced from the automatically defined version specifiers need to be tracked
in loaded environment for each targeted module loaded
to keep track loaded module is default or latest version
thus keeping ability to answer queries like
is-loaded mod@latestfrom further modulefile evaluation or module command-linethis information is kept in the
__MODULES_LMALTNAMEenvironment variable, along other alternative namesAuto symbols in this variable are recorded with a
as|prefix to distinguish them from other alternative namesfor instance
mod/1.2&mod/regular_symbol&as|mod/latestit helps to filter auto symbols from regular symbols that need to be displayed