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

nonempty operator

The non-associating, unary postfix nonempty operator is used to test its operand for emptiness.

Usage

void m(Integer[] nums) {
    Boolean haveNums = nums nonempty;
}

Description

Definition

The meaning of nonempty is defined as follows:

if (nonempty lhs) true else false

See the language specification for more details.

Polymorphism

The nonempty operator is not polymorphic.

Type

The result type of the nonempty operator is Boolean.

Note

Do not to confuse the nonempty operator described here and which takes postfix form attribute nonempty with the nonempty condition used in if, assert and while statements and which takes the prefix form nonempty attribute.

See also