[fpc-pascal] Extending an enumeration
Mark Morgan Lloyd
markMLl.fpc-pascal at telemetry.co.uk
Wed Jul 21 09:45:46 CEST 2010
Thierry Coq wrote:
> On 18/07/2010 20:56, Mark Morgan Lloyd wrote:
> ...
>> 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.
>>
> ...
> In this case, enumeration cannot be extended. If you look at it from an
> analysis point of view, you're implementing a state machine with an
> enumeration. If your state machine is extendable instead of fixed, and
> you want to add substates to it, then a possible implementation is to
> define a state class:
I agree, but that's more a poor choice of example on my part than an
invalidation of the original question.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the fpc-pascal
mailing list