Re: Info about the -Mdelphi mode

Graeme Geldenhuys via fpc-pascal <[email protected]> Sat, 25 Apr 2026 20:09:55 +0100
Newsgroups gmane.comp.compilers.free-pascal.general
Message-ID <1970176.cGoHKFZ0Nk@graeme-linux-desktop>
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





_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal