Q# language introduction 0 namespace namespace

As a new language, to understand it, we try to use the concepts of other popular languages ​​to compare with him.

 

Programs written in Q# end with .qs.

A simplest Q# program also contains the namespace namespace.

C# also has namespace, and a similar concept used in java is package.

 

There are definitions that reference other namespaces in Q#, you need to use open:

namespace Example {
    open Microsoft.Quantum.Primitive;

    // ...
}

 Java uses import. C# seems to be using.

 

Within the namespace, developers can define any operations, methods, custom types, etc.

We will learn these concepts gradually.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326479687&siteId=291194637