<p>Am 05.05.2017 21:19 schrieb "Mark Morgan Lloyd" <<a href="mailto:markMLl.fpc-pascal@telemetry.co.uk">markMLl.fpc-pascal@telemetry.co.uk</a>>:<br>
><br>
> On 04/05/17 22:30, Sven Barth via fpc-pascal wrote:<br>
>><br>
>> Hello together!<br>
>> Since revision 36105 FPC now supports the use of array constructorsusing the "[...]" syntax inside ordinary code blocks like Delphi doessince - I think - XE8. And yes, even nested ones are supported (take alook at $fpcdir/tests/test/tarrconstr5.pp for a bit of inspiration).<br>
>> Considering that this changed how "[...]" is handled I'd like you all totest whether your existing code still works (especially if it's dealingwith sets!) and to try this new feature to see if there are any problemsthat our testsuite doesn't cover yet.<br>
>><br>
>> If you report bugs, then please attach the tag "array constructors".<br>
><br>
><br>
> Ah yes, /very/ nice :-)<br>
><br>
> I append a chunk of fun code, which as it stands needs separate functions per rank (i.e. for 1 dimension, 2 dimensions and so on). Can these be rationalised using generics?</p>
<p>Generics are only useful as long as you can use the same code for different types. E.g. if you replace the Writeln inside the loop for t1's print with Print(a[i]) then you could at least generalize the print functions.<br>
Operators however would need you to stuff them into a record as only then you could define generic operators that would work on that record type. Alse the code of your addition operators differs with the types so that would not help, at least not as is.</p>
<p>Regards,<br>
Sven</p>