Note: information on this page refers to Ceylon 1.0, not to the current release.

||= (or assign) operator

The right-associative, binary infix ||= operator is used to compute the logical or of two operands, assigning the result to the left-hand operand.

Usage

variable Boolean a = false;
Boolean b = true;
a ||= b; // a becomes true

Description

Definition

The ||= operator is defined as:

if (lhs) true else lhs = rhs

See the language specification for more details.

Polymorphism

The || operator is not polymorphic.

Type

The result type of the || operator is Boolean.

See also