Swan Lake Beta2 is here.
import ballerina/io;

// You can have Unicode identifiers.
function มพื่(string ื่) {
    // Use \u{H} to specify character using Unicode code point in hex.
   io:println(ื่\u{E2D});

}

// Prefix reserved keywords with a single quote.
string 'from = "contact@ballerina.io";

// Prefix non-identifier character with a \.
string first\ name = "Ballerina";

public function main() {
    มพื่("ආයුබෝවන්");
}

Identifiers

Identifier syntax is similar to C. Keywords are reserved.

import ballerina/io;
function พิมพ์ชื่อ(string ชื่อ) {

You can have Unicode identifiers.

   io:println(ชื่\u{E2D});

Use \u{H} to specify character using Unicode code point in hex.

}
string 'from = "contact@ballerina.io";

Prefix reserved keywords with a single quote.

string first\ name = "Ballerina";

Prefix non-identifier character with a .

public function main() {
    พิมพ์ชื่อ("ආයුබෝවන්");
}
bal run identifiers.bal
ආයුබෝවන්
import ballerina/io;

// You can have Unicode identifiers.
function มพื่(string ื่) {
    // Use \u{H} to specify character using Unicode code point in hex.
   io:println(ื่\u{E2D});

}

// Prefix reserved keywords with a single quote.
string 'from = "contact@ballerina.io";

// Prefix non-identifier character with a \.
string first\ name = "Ballerina";

public function main() {
    มพื่("ආයුබෝවන්");
}

Identifiers

Identifier syntax is similar to C. Keywords are reserved.

import ballerina/io;
function พิมพ์ชื่อ(string ชื่อ) {

You can have Unicode identifiers.

   io:println(ชื่\u{E2D});

Use \u{H} to specify character using Unicode code point in hex.

}
string 'from = "contact@ballerina.io";

Prefix reserved keywords with a single quote.

string first\ name = "Ballerina";

Prefix non-identifier character with a .

public function main() {
    พิมพ์ชื่อ("ආයුබෝවන්");
}
bal run identifiers.bal
ආයුබෝවන්

In the creation of Ballerina, we were inspired by so many technologies. Thank you to all that have come before us (and forgive us if we missed one): Java, Go, C, C++, D, Rust, Haskell, Kotlin, Dart, TypeScript, JavaScript, Python, Perl, Flow, Swift, Elm, RelaxNG, NPM, Crates, Maven, Gradle, Kubernetes, Docker, Envoy, Markdown, GitHub and WSO2.

Cookie Policy

This website uses cookies so that we can provide you with the best user experience. Read our Cookie Policy to find out more.

If you wish to disable cookies you can do so from your browser.

I Understand