Skip to main content

Expressions

In addition to the basic primitives this language also has some additional expression syntax.

Identifiers

knot
const foo = 10;
const result = foo + foo * foo / foo;
knot
const foo = 10;
const result = foo + foo * foo / foo;

Group

knot
const result = 5 * (5 - 10);
knot
const result = 5 * (5 - 10);

Closure

knot
const result = {
let foo = 10 - 3;
let bar = 4 * 7;
foo > bar;
};
knot
const result = {
let foo = 10 - 3;
let bar = 4 * 7;
foo > bar;
};

Property Access

knot
import { library } from "@/library";
const book = library.book;
knot
import { library } from "@/library";
const book = library.book;

Function Call

knot
func run -> {};
const result = run();
knot
func run -> {};
const result = run();