<p>Am 21.02.2016 11:38 schrieb "<a href="mailto:thaddy@thaddy.com">thaddy@thaddy.com</a>" <<a href="mailto:thaddy@thaddy.com">thaddy@thaddy.com</a>>:<br>
><br>
><br>
> I have been pondering with that idea ever since the implementation of strings for case.<br>
[skip]<br>
> In other words, use the instance pointer as an ordinal value.<br>
> It looks a lot more logical but as it stands it is of course invalid syntax.<br>
> Is it possible to implement?<br>
> If so, has it any value? To me at least it looks feasable and less like syntactic sugar than some features.</p>
<p>Would it be possible to implement? Yes<br>
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.<br>
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.</p>
<p>Regards,<br>
Sven</p>