J. Gareth Moreton <gar...@moreton-family.com> schrieb am Fr., 5. Juli 2019,
14:02:

> I'm glad we agree on the "is" operator.  Personally I would like to
> extend it so it accepts "if (I is TMyEnum) then" when I is also of type
> TMyEnum, since it may be the case that you're reading I directly from a
> stream, either individually or as part of a record, in which case
> converting I from an Integer to TMyEnum is a little inconvenient.  When
> you get down to the compiled assembly language it shouldn't really
> matter anyway.
>

It might not matter from the assembly point of view, but it matters from
the language point of view. When we say that enum values only contain valid
values then "myenum is TMyEnum" *must* always evaluate to true, because
otherwise there's an exception of the rule that enums only contain valid
values.

Regards,
Sven

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

Reply via email to