I tried to use Delphi's syntax for anonymous methods:
type
fun = reference to function(): Integer;
Fpc shows a syntax error:
Error: Identifier not found "reference"
What's the Free Pascal equivalent to Delphi's anonymous methods, if any?
Anonymous methods are not implemented in FreePascal. The list of such features is here.