[fpc-devel] Idea/question about a language (syntax) extension

Alexander Klenin klenin at gmail.com
Tue Dec 22 06:27:35 CET 2009


On Tue, Dec 22, 2009 at 14:42, Paul Ishenin <ip at kmiac.ru> wrote:
> 22.12.2009 11:30, Flávio Etrusco wrote:
>>
>> Hi all,
>> I want to propose a syntax extension for the compiler to check
>> parameters' name on function/procure calls. Would such a patch be
>> accepted? Does anybody have a suggestion for the  syntax? (i guess
>> something along the line of a compiler directive to go together with
>> the parameter value to avoid syntax incompatibility...)
>
> You mean something like Basic has:
>
> CallSomething(Arg1=10, Arg2='Test') ?

I'd say rather something like

CallSomething(Arg1:=10, Arg2:='Test')

which is already sort-of-supported by Delphi for automation classes:

http://stackoverflow.com/questions/885942/named-optional-parameters-in-delphi

Extending such support to native procedures and functions
would be, in my opinion, a good idea.

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list