[fpc-devel] Ability to handle instance pointers as ordinal type.

Sven Barth pascaldragon at googlemail.com
Sun Feb 21 12:15:39 CET 2016

Am 21.02.2016 11:38 schrieb "thaddy at thaddy.com" <thaddy at thaddy.com>:
> I have been pondering with that idea ever since the implementation of
strings for case.
> In other words, use the instance pointer as an ordinal value.
> It looks a lot more logical but as it stands it is of course invalid
> Is it possible to implement?
> If so, has it any value? To me at least it looks feasable and less like
syntactic sugar than some features.

Would it be possible to implement? Yes
Would that mean that instance pointers would be handled as ordinal values?
No, because "case" is merely a parser construct. In principle the condition
and the case labels could be anything. String constants aren't ordinal
values after all either.
It might look logical but it would be a complete paradigm shift for
case-statements, because the case labels are supposed to be constant values
(ordinal, including enums and string constants) while variables (local,
global, fields) are not constants however.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160221/adb0a6be/attachment.html>

More information about the fpc-devel mailing list