Am Di., 27. Nov. 2018, 12:03 hat Mattias Gaertner via fpc-pascal <
fpc-pascal@lists.freepascal.org> geschrieben:

> On Tue, 27 Nov 2018 11:35:22 +0100
> Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote:
>
> >[...]
> > > const
> > >         kSomeDays:TDays = [Mon, Wed];
> >[...]
> > The difference between typed and untyped constants are available
> > everywhere else in the language as well, so I have no qualms (at
> > least for now?) to error out on them.
>
> What about
>
> {$WritableConst off}
> const kSomeDays:TDays = [Mon, Wed];
>
> ?
> BTW, how do you name this? "proper typed const"?
>

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.

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.

Regards,
Sven

>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to