<p>Am 07.02.2016 12:51 schrieb "Michael Van Canneyt" <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>>:<br>
><br>
><br>
><br>
> On Sat, 6 Feb 2016, Sven Barth wrote:<br>
><br>
>>><br>
>>> Because of 2 reasons:<br>
>>><br>
>>> 1. Delphi introduced the create constructor.<br>
>>><br>
>>> 2. A literal such as [10,20,30,40] is a set in pascal, not an array.<br>
>><br>
>><br>
>> The answer is no longer correct with current Delphi versions. It now is<br>
>> "because we haven't implemented it yet".<br>
><br>
><br>
> Indeed. Well, I'm still on XE, the jump to XE 10 is for next month.<br>
> Seems I'll have some reading up to do...<br>
><br>
> Disregarding the fact that they introduced now 2 syntaxes to initialize an<br>
> array, I'm curious what Jonas is going to say, because I remember he always advocates that the type of an expression is determined by the terms/factors in the expression, not by what you assign it to.<br>
><br>
> For<br>
> ['abc','def'] + ['ghi','jkl']<br>
> it is more or less clear.<br>
><br>
> But what is the type of this expression:<br>
> [1,2,3] + [4,5,6]<br>
> is it an array or a set ?<br>
><br>
> It probably means that they regard [] always as an array, and added some<br>
> kind of automatic set-to-array type assignment compatiblity for types that somehow fit in a set.</p>
<p>Well... FPC is handling them special as well, after all we support open array parameters as well which clearly are no sets either. ;) They are parsed into an array constructor nodes and then converted into either an open array or a set by the node they're contained in. Support for normal arrays will simply(TM) mean the addition of additional special cases... (yes, it's easier said than done ;) )</p>
<p>Regards,<br>
Sven</p>