[fpc-pascal] Info about the -Mdelphi mode

Graeme Geldenhuys mailinglist at geldenhuys.co.uk
Sat Apr 25 21:09:55 CEST 2026


On Saturday, 25 April 2026 18:38:09 BST Tomas Hajny via fpc-pascal wrote:
> it should be strongly discouraged because it is not compliant to Pascal.

Ummm... Let's use examples:

var in a parameter list. Meaning: pass by reference.
var inside a procedure/function block. Meaning: variable declaration.

Same keyword, yet two totally different meanings. But hey, everyone is okay 
with that.

There is already a clear precedent for 'var' having different meanings 
depending on context. An inline var simply defines and scopes a variable at 
the point of use. I see no harm is supporting it.

FPC already supports things like Generics and anonymous functions in some 
modes (which definitely weren't in Wirth's original Pascal), the "not 
compliant" argument feels a bit like moving the goalposts.

It's called language evolution.

Regards,
  Graeme







More information about the fpc-pascal mailing list