Detailed documentation for each feature in FPC Unleashed. Every feature has its own page with the full grammar, semantics, examples, and the modeswitch that gates it. All listed modeswitches are enabled by default in {$mode unleashed}; most can also be opted into from objfpc / delphi via {$modeswitch ...}.
Declare variables at point of first use inside any statement block, with explicit types, type inference (var x := expr), or as for-loop counters. Scope is the enclosing begin..end, with shadowing rules and interaction with the existing var section spelled out in detail.
Enabled via {$modeswitch inlinevars}.
Lightweight anonymous record types written in parentheses, e.g. (Integer, String) or (name: string; age: integer). Supports tuple literals, destructuring assignment, comparison, and works wherever a record works (function results, parameters, fields). Built on the existing record infrastructure, so managed types, copy semantics, and calling conventions are inherited for free.
Enabled via {$modeswitch tuples}.
Use if, case, and try as expressions that yield a value, so you can drop temporary variables for conditional assignment. Multi-statement branches use begin..end and the last expression in the block is the result.
Enabled via {$modeswitch statementexpressions}.
Pattern matching with first-match semantics that replaces case..of for non-ordinal subjects (tuples, strings, arbitrary expressions). Adds catch-all (_ / else), tuple wildcard patterns, condition-based branches, fallthrough mode, and an expression form that yields a value.
Enabled via {$modeswitch match}.
Initialize several variables of the same type in one declaration, e.g. a, b, c: integer = 42;. Works in var, typed constants, and inline var. Each variable gets an independent copy of the value -- assigning to one does not affect the others.
Enabled via {$modeswitch multivarinit}.
Word-based modify-and-assign operators that the standard set is missing: div=, mod=, and=, or=, xor=, shl=, shr=.
Always available in every mode; no modeswitch and independent of {$coperators on}.
Declare arrays of labels with numeric ranges (label state[0..4]) or string keys (label action['start', 'stop']) and jump to them by index. Useful for dispatch tables and state machines.
Available whenever {$goto on} is active; no dedicated modeswitch.
Catch-all page for smaller, targeted improvements that unlock Pascal patterns standard FPC modes reject -- e.g. string-to-ordinal typecast in constant expressions (dword('RIFF')), or Delphi-style implicit generic / specialize syntax made available in any mode via {$modeswitch implicitgenerics}. Some entries are gated on their own modeswitch (and enabled by default in unleashed), others are unleashed-only with no separate switch; each entry on the page states which.
Two delimiter forms for string literals spanning multiple source lines without manual + or LineEnding: backtick `...` (extended literal, embedded newlines tolerated) and a separate triple-quote form with indentation handling. They differ in tokenization and composition rules -- the page covers both in depth, including escaping and interaction with concatenation. Stock FPC actually accepts these but never documented them; this page fills that gap.
Enabled via {$modeswitch multilinestrings}.