Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Length

The length operator denotes the number of elements in its slice operand.

Process

At runtime:

  1. the operand is evaluated; and
  2. the number of elements in the slice is computed, and is the length's value.

Assertions

  1. The operand's type is a slice type, and the length's result has type u64.

Syntax

length_operator = number_sign ;