export
The export keyword discloses symbols within translation units to be visible across multiple source files. Any symbols in a source file not exported are internal to that file. This is why the Bjarne language does not support static functions and static global variables; any symbols not exported can be considered static if they were C++.
The export keyword can export: namespaces, classes, structs, enums, global functions, and global variables. Exporting a namespace exports the namespace itself and its all subordinates. However, the private symbols of namespaces are not visible from other modules.
Namespace Inheritance
For more information on the namespace inheritance, please refer to Namespace Inheritance.
Syntax
export int32 constant = 7;
export void fubar()
{
/* implementation... */
}
export interface purist
{
/* implementation... */
};
export class object
{
/* implementation... */
};
export struct data
{
/* implementation... */
};
export enum record
{
/* implementation... */
};
export namespace library
{
/* implementation... */
};
Example Code
export namespace library // export library and all subordinates.
{
namespace internal_submodule // exported, but this is implicitly private and not exposed to other modules.
{
/* implementation... */
};
public:
namespace submodule
{
public:
struct data
{
/* implementation... */
};
};
};