Skip to content

Initialization

There are three ways to initialize a variable in Bjarne language:

Default Initialization

maybe_uninit var Type Identifier; // mutable uninitialized instance of Type

Assignment Initialization

var Type Identifier = value; // value-initialized mutable instance of Type.
var Type Identifier = {}; // zero-initialized mutable instance of Type.
var Type Identifier = { _field: value }; // value-initialized mutable instance of Type.

Direct Initialization

var Type Identifier{ value }; // value-initialized mutable instance of Type.
var Type Identifier{}; // zero-initialized mutable instance of Type.
var Type Identifier{ _field: value }; // value-initialized mutable instance of Type.

Placement Construction