Module names in imports

A module alias can be introduced via the as keyword, after which the original module name is inaccessible:

  1. import std/strutils as su, std/sequtils as qu
  2. echo su.format("$1", "lalelu")

The notations path/to/module or “path/to/module” can be used to refer to a module in subdirectories:

  1. import lib/pure/os, "lib/pure/times"

Note that the module name is still strutils and not lib/pure/strutils, thus one cannot do:

  1. import lib/pure/strutils
  2. echo lib/pure/strutils.toUpperAscii("abc")

Likewise, the following does not make sense as the name is strutils already:

  1. import lib/pure/strutils as strutils