<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2018-05-21 0:52 GMT+02:00 Sven Barth via fpc-pascal <span dir="ltr"><<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span class="gmail-"><div><div class="gmail_quote"><div dir="ltr">The thing is that I can easily imagine the Delphi devs to be so stoned to use the "[...]" for static arrays inside dynamic arrays as well which could lead to constructs like the following because they forget that dynamic arrays could be part of static arrays as well:<br></div></div></div></span><span class="gmail-"><div dir="auto"><br></div><div dir="auto">=== code begin ===</div><div dir="auto"><br></div><div dir="auto">var</div></span><div dir="auto"> v: array[0..2] of array of array[0..2] of LongInt = ([[1, 2, 3], [4, 5, 6]], [], [[7, 8, 9]]);</div><div dir="auto"><br></div><div dir="auto">=== code end ===</div><div dir="auto"><br></div><div dir="auto">Yes, I have absolutely no confidence in the Delphi developers. </div></div></blockquote><div><br></div><div>Sometimes they have fantasy ^^. Don't underestimate them, I am sure they can do something more unexpected ;) For NewPascal mode I see this like :</div><div><br></div><div><div>var</div><div> v: array[0..2] of array of array[0..2] of LongInt = ([(1, 2, 3), (4, 5, 6)], [], [(7, 8, 9)]);</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span class="gmail-"><div dir="auto">I don't want to use a modeswitch for every tiny little bit of feature. What we could do however would be a modeswitch for a strict Delphi mode that prohibits extensions and code that does not work in Delphi (like global operators and global generic functions). This could be used for code that is shared with Delphi to avoid potentially breaking compilability with Delphi if one is mainly using FPC for testing.</div></span></div></blockquote><div><br></div><div>IMO potentially breaking compatibility is better than lock/prohibition for missing features in Delphi (or waiting for Delphi implementation). Programmers are not stupid and most of Delphi users knows what Delphi have and what can be potentially risky. We have tons of examples which should be disabled in Delphi mode but it works for comfort. r39045 is for sure not comfortable IMO without real important reason, but this is just my opinion.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">The gain is consistency with static array constants. You don't need to care about whether it's a dynamic array or a static one, you simply use the same syntax. </div><div dir="auto">Also what do you care about mode ObjFPC anyway? One purpose of the mode *is* that it can go a different route than those modes that copy existing implementations. </div></div></blockquote><div><br></div><div>I am worried about all Pascal modes including ObjFPC and Delphi mode. :)</div><div> </div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>