[fpc-pascal] Feature announcement: Dynamic array extensions

Sven Barth pascaldragon at googlemail.com
Sun May 20 22:50:31 CEST 2018


Maciej Izak <hnb.code at gmail.com> schrieb am So., 20. Mai 2018, 21:49:

> Why you decide to prohibit static array constants inside dynamic array
> constants for Delphi modes in r39045? I do not understand this decision. It
> is some punishment for using Delphi mode? -,- IMO bad decision.
>

I prohibited it because Delphi does not support it correctly and I don't
know whether they'd use the usual "(...)"-syntax for the static arrays or
switch to the dynamic array one. To avoid potential backwards compatibility
problems I decided to simply disallow it. And to be fair: how often do you
declare dynamic arrays that consist of static arrays?

For the consequence the following code
>
> var
>   f: array of TSomeRec = [(a: 10; b: ['1', '2']), (a: 20; b: ['6'])];
>
> should be also prohibited in Delphi mode, because it not works in Delphi
> like static array constants inside dynamic array constants...
>

I had not tested that one. In consequence that should indeed be disallowed
as well. Though here the syntax probably wouldn't provide problems in the
future.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180520/a7f6d340/attachment.html>


More information about the fpc-pascal mailing list