<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Am Di., 27. Nov. 2018, 12:03 hat Mattias Gaertner via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 27 Nov 2018 11:35:22 +0100<br>
Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
<br>
>[...]<br>
> > const<br>
> > kSomeDays:TDays = [Mon, Wed];<br>
>[...]<br>
> The difference between typed and untyped constants are available<br>
> everywhere else in the language as well, so I have no qualms (at<br>
> least for now?) to error out on them.<br>
<br>
What about<br>
<br>
{$WritableConst off}<br>
const kSomeDays:TDays = [Mon, Wed];<br>
<br>
?<br>
BTW, how do you name this? "proper typed const"?<br></blockquote></div><div dir="auto"><br></div><div dir="auto">For the compiler it makes no difference whether a typed const is writable or not. A typed const is a typed const and can't be used for some things that untyped consts can be used for. </div><div dir="auto"><br></div><div dir="auto">One further difference: untyped consts might not even be part of the binary's data section in case of ordinal, float or set consts as they simply become part of the code section. Typed consts always reside in the data section. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>