SecreC 2 language
2.8.0 (2023.09)
Language and standard library reference
|
Modules in SecreC
SecreC supports very simple module system. A module name can be declared with module keyword, and module can be imported using a import keyword. Filename of the module must match with the modules name. Imported modules are searched within paths specified to the compiler. Importing a module will make all of the global symbols defined within the imported module visible. Modules can not be separately compiled and linked, they simply offer a way to break code into components.
Listing 1: Module syntax
Imported symbols will not be exported by a module. If an imported symbol is redefined, a type error is raised. Procedures and templates with the same name but different parameters are considered to be different symbols.