← board

schema types (ISO 10206 value-parameterized types) — experimental

What

ISO 10206 Extended Pascal schema types: types parameterized by VALUES (discriminants), not by types — Ada-style:

type
  matrix(m, n: integer) = array[1..m, 1..n] of real;
var
  a: matrix(3, 4);                 { concrete instance }
procedure invert(var x: matrix);   { formal accepts any m x n; bounds
                                     queryable at runtime }

Even ISO string(80) is officially a schema (capacity = discriminant).

Why (user, 2026-07-11)

"They have some elegance, and on first sight don't seem to conflict any other syntax." Valid concept — but note pxx already covers the dominant use case (runtime-dimensioned arrays) with dynamic arrays + open array parameters, so this is elegance, not necessity. Hence experimental.

Scope sketch

Gate

Experimental rules: Pascal tests green + self-host byte-identical; feature behind a switch if it ever destabilizes (FPC-faithful default per user rule — FPC itself does NOT support schemas outside partial ISO modes).