[fpc-pascal] named parameter

Sven Barth pascaldragon at googlemail.com
Mon May 29 08:01:28 CEST 2017


Am 29.05.2017 07:13 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:
>
>
> > On May 28, 2017, at 5:22 PM, Mark Morgan Lloyd <
markMLl.fpc-pascal at telemetry.co.uk> wrote:
> >
> >> IMO though it does improve readability in long functions with lots of
> >> parameters, like windows api style procedures that have 5 or more
> >> parameters and you can't figure out which param is
> >> which
> >
>
> You mean like this?
>
> function Foo (theString: string; options: set of TFoo): boolean;
> begin
> end;
>
> Foo(theString: 'foo', options: []);
>
> Objective-C has this mandatory and it made for stupidly long method names
that just looked terrible but it was optional Pascal makes it look nicer.
The declaration syntax is already the same as the label for the calling
syntax so that seems like a nice fit.

If anything like this would be implemented, then the already existing
syntax (for variant dispatch calls) would be used which uses ":=".

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170529/9266aa2d/attachment.html>


More information about the fpc-pascal mailing list