Am 21.02.2016 11:38 schrieb "tha...@thaddy.com" <tha...@thaddy.com>:
>
>
> I have been pondering with that idea ever since the implementation of
strings for case.
[skip]
> 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
syntax.
> 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.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to