Work in progress - Concept


Namespaces are the organisational blocks in all of the .NET languages and this is no different in K# .NET.

A namespace is defined via the namespace keyword folowed by the namespace's identifier.

namespace <namespaceIdentifier>

Namespace identifiers

A namespace identifier starts with the root namespace configured for the project followed by a :: and a namespace path. If the namespace identifier does not start with the root namespace the root namespace is implicitly prefixed.

The root namespace

A namespace path is made up namespace

Implicit Namespacing

If no namespace is specified the default is the root namespace configured for the project prefixed to the relative path from the ksproj file (removing ).

For example, if you have the following folder structure:


Given that class(es) in Model/Assets/PostAsset.ks are not wrapped in a namespace definition, and the root namespace configured for MyProj is MyCompany::MyProject, the namespace for those classes will be MyCompany::MyProject::Model::Assets.

Importing Namespaces

A namespace is imported so as it's member types can be used

Implicit import