<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 13, 2008, at 9:52 AM, Jay wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote>I'm being a bit lazy here. I could experiment more with the compiler and check the green book.<br> <br> <br>The compiler does not correctly implement:<br> <br> <br> <br> VAR a : ARRAY [0..0] OF CHAR := ARRAY OF CHAR {'a'};<span class="Apple-converted-space"> </span></blockquote></div></span></blockquote><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote> <br>at least for reasons of alignment.<br> <br> <br>What is this code supposed to mean?</blockquote></div></span></blockquote>It should assign the elements of the open array to those of the fixed array.<br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote><br> <br> <br>Is ARRAY OF CHAR {'a'} a constant fixed array with a deduced size of 1?</blockquote></div></span></blockquote><div><br></div><div>No, it is open.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote><br>Or a constant open array with a deduced size of 1?</blockquote></div></span></blockquote><div>No.</div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote><span class="Apple-style-span" style="color: rgb(20, 79, 174); font-size: 12px; -webkit-text-stroke-width: -1; ">I believe it is supposed to be a constant open array.</span></blockquote></div></span></blockquote><div>Yes.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote> <br> <br>And then, what is the difference?<br>What are the visible differences?<br> <br> <br>Between<br> <br> VAR a : ARRAY [0..0] OF CHAR := ARRAY OF CHAR {'a'};<br>and<br> VAR a : ARRAY [0..0] OF CHAR := ARRAY [0..0] OF CHAR {'a'};<br> <br>Can I act on "a" different at runtime between the two?<br>Given that its static type is the same, I doubt it. But I haven't really thought about it.<br> <br> <br>If there is no visible difference, should the compiler implement it as the second -- probably saving a tiny bit of space.<br> <br> <br>And if not, is it supposed to generate an open array, and an initializer to do the copy?</blockquote></div></span></blockquote><div>Probably should.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><blockquote><br> <br> <br>A constant like<br>CONST a = ARRAY OF CHAR{'a'}<br> <br> <br>is an open array I believe, with visible differences, I think, not sure,<br>so in the unlikely even that a "bigger" change is ok here, it has to be careful of this and other scenarios.<br> <br> <br>Really, I'm just being a bit slow. I bet these should remain open arrays but somewhere the compiler gets confused and computes the alignment and perhaps size as a fixed array, leading to assertion failures in the compiler, depending on the actual sizes, e.g.:<br> <br> <br>MODULE Main;<br><*UNUSED*> VAR a : ARRAY [0..0] OF CHAR := ARRAY OF CHAR {'a'};<br><*UNUSED*> VAR b : ARRAY OF CHAR := ARRAY OF CHAR {'a'};<br>BEGIN<br>END.<br> <br> <br>fails an assertion in the compiler, depending on the target -- but I expect all x86/AMD64 targets.<br> <br>Thanks, <br> - Jay<br></blockquote></div></span></blockquote></div><br></body></html>