[fpc-pascal] Extending an enumeration
jcchu at acm.org
Mon Jul 19 05:08:56 CEST 2010
> Yes, I was thinking that. However if the basic class was say a
> round-robin scheduler with phases rrQuiescent and rrInitialised and the
> descendant was say an HP comms protocol handler with additional phases
> hpReceivingPadding, hpReceivedSync and so on it would seem to be
> questionable practice to have to define all possible enumerated values
> in the basic class.
It seems to me that these states are mutually exclusive, and you won't
be using the SET type thereof. An enumeration type in this case doesn't
seem to offer any real benefit. Instead you could consider using
separate constant definitions, which will also be (mostly) syntactically
compatible with your existing code.
More information about the fpc-pascal