[fpc-pascal] Named optional arguments

Ryan Joseph genericptr at gmail.com
Sun Nov 28 03:02:11 CET 2021



> On Nov 27, 2021, at 5:00 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> 
> The compiler does not know which routine is called upon parsing the parameter declarations (which would mean that error reports would need to be deferred until the lookup of the routine failed).

My idea was to not actually have it affect overloading except in the case where the param names don't match which would ignore the call (so in your example below nothing changes).

Otherwise if the name was actually part of the overloading we would have to allow functions with the same parameter type but different names, i.e.:

procedure Foo(Arg1: String = '');
procedure Foo(Arg2: String = '');

and that would be a big change to the language and have all sorts of implications.

So it's really just a minor hint to make the call more readable in the case of long function names.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list