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

Structure Declarations

Structures are named global declarations, subject to the behavior described here.

Resultant Symbol

References to structure declarations resolve to the declared structure type value, with the declared fields.

Assertions

  1. Each field's type expression is a value of the type type.
  2. Each field's type is runtime representable.
  3. Each field's name is unique within the structure.

Syntax

structure_declaration_field = identifier, colon, expression, semicolon ;

structure_declaration = structure, identifier, left_brace, { structure_declaration_field }, right_brace ;