Static initialization

The triple script dialect restricts the number of programming constructs that may appear in a module's top-level scope. Aside from definition of the exported class (or function, etc.), the only other constructs that may appear are simple static assignments.

A class may benefit from the definition of some enum-like values, for example. Suppose we had a  class and we wanted to be able to discriminate between DOS-style line separators and Unix-style newlines.

export class LineWriter { /* ... class internals omitted for brevity ... */ }

LineWriter.TYPE_CRLF = 0; LineWriter.TYPE_LF = 1;

The definition of  and   is valid here, because it's a numeric literal constant, which is one of the permissible forms of static assignment.

NB: Not to be confused with SSA form in compiler IR.