I was creating some functions in Delphi 5, and accidentally I tried to compile without commas separating a list of parameters, and oddly it worked completely normal.
I tried isolating the issue as follows :
program Project1;
{$APPTYPE CONSOLE}
procedure foo(i : integer; s : string; di : integer = -1);
begin
WriteLn(s);
end;
var
str: string;
int: integer;
begin
str := 'aaa';
int := 1000;
foo(int str int);
ReadLn;
end.
And it compiles, no exceptions are thrown and the paremeters reachers the functions completely as expected.
What I noticed is that if I remove the default parameter in the end, it start throwing compile error Not enough actual parameters
Why does Delphi has this behaviour? Is this some kind of a compiler bug or a weird mechanic instead?