[fpc-pascal] IE 200307043
Prince Riley
wmarketing3 at gmail.com
Mon May 25 22:39:07 CEST 2009
Jonas,
Thanks for the reply.
That's a very interesting answer. So am I understanding you to say that the
expression of the form
var := constant + numeric literal ;
is an invalid expression (syntax) in Object Pascal?
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?
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 ?
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).
On Mon, May 25, 2009 at 6:45 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>wrote:
>
> On 25 May 2009, at 19:48, Prince Riley wrote:
>
> There seems to be a bigger issue on this... but perhaps someone else
>> confirm
>> that the following programs, similar to the failing one, work.
>>
>
> That's because the error was in the constant evaluation (nil and 1 are both
> constants).
>
>
> Jonas
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20090525/f5b07c1a/attachment.html>
More information about the fpc-pascal
mailing list