|
||||||||||||
|
|
||||||||||||
ImportLocates, compiles (if necessary) and initializes (..) module, and makes it, or named entities from it, available in enclosing scope. Imports may be declared inside modules, namespaces, classes, interfaces and functions.
Libraries (they are actually namespaces) are
referenced using dotted name, such as `` Script is referenced using string literal containing path to script. Path can be either absolute, starting from domains container, or relative to importing script. Script is parsed, compiled and initialized, if necessary. This operation might generate errors. After scope is loaded there is choice:
In all situations it is an error if names of two entities clash. Already declared or exported entities cannot be overwritten; it is an error to do so. Also note that any entities that import statement exports are not visible outside the current module. import := "import" import-source [ import-as ] ";" import := "import" import-source ":" import-list ";" import-name := symbol ( "." symbol )* import-source := ( string-literalpath | import-name ) import-as := "as" symbolnewname import-list := "*" import-list := import-entity ( "," import-entity )* import-entity := import-name ["." "*"] [ import-as ]
See also
| Scopes and entities
| Definition statements
| Classes
| Interfaces
| Functions and methods
| Modules
| <import>
| Import expression
| Grammar
| Namespaces
| Permissions
|
||||||||||||
|
|
||||||||||||