Re: D5 Constant expression expected

From: Marco van de Voort (marcov_at_stack.nl)
Date: 04/18/04


Date: Sun, 18 Apr 2004 18:00:44 +0000 (UTC)

On 2004-04-18, Maarten Wiltink <maarten@kittensandcats.net> wrote:
> "Marco van de Voort" <marcov@stack.nl> wrote in message
> news:slrnc84ob5.1kjs.marcov@toad.stack.nl...
>> On 2004-04-16, Jens Björnhager <jensbj@home.se> wrote:
> [...]
>>> Why is not my constant-in-a-record treated as a constant?
>>
>> It is not a true constant, but a memory reference (structured constant).
>>
>> iow you could change the constant record with pointers in some
>> implementations, which is why it is disallowed.
>
> It's still possible to resolve it at compile time.

Yes of course. We could also interpret it with passcript.

> I'd much rather have the obscure bugs that result from illicitly changing
> the memory where constants are stored than this behaviour of treating some
> constants as more constant than others.

I don't see why it would be needed anyway. It only complicates the compiler
to avoid some stupid odd ball case to fail.

IOW I don't see a theoretical reason (since it is no real constant, you can
also declare it the same with VAR), and no practical reason why this should
be implemented.



Relevant Pages

  • Re: D5 Constant expression expected
    ... It is not a true constant, but a memory reference (structured constant). ... iow you could change the constant record with pointers in some ...
    (comp.lang.pascal.delphi.misc)
  • Re: D5 Constant expression expected
    ... > It is not a true constant, but a memory reference (structured constant). ... > iow you could change the constant record with pointers in some ...
    (comp.lang.pascal.delphi.misc)
  • Re: D5 Constant expression expected
    ... "Marco van de Voort" wrote in message ... > IOW I don't see a theoretical reason (since it is no real constant, ...
    (comp.lang.pascal.delphi.misc)