<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2018-05-20 20:44 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 class="gmail_quote" dir="auto"><div dir="ltr">Anthony Walter <<a href="mailto:sysrpl@gmail.com" target="_blank">sysrpl@gmail.com</a>> schrieb am So., 20. Mai 2018, 19:09:<br></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="ltr"><div class="gmail_extra">By the way, what's the reason for differences in () / [] syntax between objpas and delphi mode?<br></div></div></blockquote></div><div dir="auto"><br></div></span><div dir="auto">For the non-Delphi modes I decided to keep consistency with static array constants (which use the same syntax in Delphi btw!). For the Delphi modes I followed what Delphi does. And for some reason the Delphi devs thought it better to use a different syntax than that for static arrays. 🤷‍♀️</div></div></blockquote><div><br></div><div>Gratz, seems that I will need to update NewPascal soon to get this fresh feature :). </div><div><br></div><div>They decide for [] probably because it is similar syntax like for open arrays. IMO "[]" syntax has more dynamic meaning/nature so looks more proper for this feature (as you said "()" syntax is used for static arrays), but this is probably individual taste.</div><div><br></div><div>"[]" also might be better for something like this :</div><div><br></div><div>var</div><div>  f: array of TSomeRec = [(a: 10; b: ['1', '2']), (a: 20; b: ['6'])];</div><div><br></div><div>instead of</div><div><br></div><div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">var</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">  f: array of TSomeRec = ((a: 10; b: ('1', '2')), (a: 20; b: ('6')));</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">The main gain of different syntax between Delphi and ObjFpc is more troubles for Pascal Programmers. :(</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px">Why you decide to </span>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.</div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">For the consequence the following code</div></div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">var</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">  f: array of TSomeRec = [(a: 10; b: ['1', '2']), (a: 20; b: ['6'])];</div>

<br></div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">should be also prohibited in Delphi mode, because it not works in Delphi like static array constants inside dynamic array constants...</div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>