Jonas,<br><br>Thanks for the reply. <br><br>That's a very interesting answer. So am I understanding you to say that the expression of the form<br><br><div style="margin-left: 40px;">var := constant + numeric literal ;<br>
</div><br>is an invalid expression (syntax) in Object Pascal? <br><br>Why would the expression adding a numeric literal and a numeric constant create anything other than a numeric value? Both are assignment compatible with the pointer type, both have values known at compile time. True both have known values, but how does that change in the addition operation? <br>
<br>Both operands in the 'p := null + 1; expression' are constants that's true. But isn't one a literal constant and in Object Pascal an expression of the form: variable := constant + numeric literal is valid ? <br>
<br>Now I grant you an expression like 'a' + 1; would be invalid syntax; but in 'null + 1' there's only one constant and a numeric literal, not two. So unless I misunderstand you, or there's some run-time evaluation, shouldn't this expression be valid? (but I still worry about how the compiler would assign the correct type to the pointer (is it a valid address). <br>
<br> <br><br><div class="gmail_quote">On Mon, May 25, 2009 at 6:45 PM, Jonas Maebe <span dir="ltr"><<a href="mailto:jonas.maebe@elis.ugent.be">jonas.maebe@elis.ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
On 25 May 2009, at 19:48, Prince Riley wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There seems to be a bigger issue on this... but perhaps someone else confirm<br>
that the following programs, similar to the failing one, work.<br>
</blockquote>
<br></div>
That's because the error was in the constant evaluation (nil and 1 are both constants).<br><font color="#888888">
<br>
<br>
Jonas</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br>