In ATS, static load (or staload for short) refers to the creation of a namespace populated with the declared names in a loaded package.
Suppose that a file named foo.sats contains the following code:
The following staload-declaration introduces a namespace FOO for the names declared in foo.sats: The prefix $FOO. needs to be attached to a name in the namespace FOO in order for it to be referenced. For instance, the names available in the namespace FOO are all referenced in the following code:If the file foo.sats is staloaded as follows for the second time:
then foo.sats is not actually loaded by the compiler. Instead, FOO2 is simply made to be an alias of FOO.It is also allowed for foo.sats to be staloaded as follows:
In this case, the namespace for the names declared in foo.sats is opened. For instance, the following code shows that these names can now be referenced directly:Let us suppose that we have the following sequence of declarations:
Does the second occurrence of aValue refer to the one introduced in the first declaration, or it refers to the one declared inside foo.sats? The answer may be a bit surprising: It refers to the one introduced in the first declaration as a binding for the occurrence of a name is resolved in ATS by searching first through the available names delcared in the same file.