[fpc-devel] C-block reference syntax (blocker for 3.2)

Ryan Joseph genericptr at gmail.com
Wed Dec 11 20:20:42 CET 2019



> On Dec 10, 2019, at 5:14 PM, Sven Barth via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> 
> From the view of the *caller* you are mostly right. Though the square brackets can't be left away, cause we're talking about an array parameter here. If it would be allowed for array of const then it would also need to be allowed for other open array parameters for consistency. But then it wouldn't be consistent with open array arguments in the middle. Each exception makes the language more complex.
> 

Yeah it's an array but it's also slightly annoying when the meaning is basically what we know as "varargs", i.e. an unspecified amount of extra parameters. This common pattern in Format() is a good example of a last parameter array of const which doesn't really gain anything by adding the extra [] every time. I smell another mode switch. :)

Format('%dx%d',[100,100]);

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list