[fpc-pascal] Extending an enumeration

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Fri Dec 28 11:42:25 CET 2012


Is it possible to extend an enumeration, while preserving strong type 
checking? In other words, given existing code like

type    TUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID);
         TLocalServerCapabilitiesBase= (lscConnected, lscCanIssueGUID, 
lscIsFirebird);

         TUpstreamServerCapabilities= set of 
TUpstreamServerCapabilitiesBase;
         TLocalServerCapabilities= set of TLocalServerCapabilitiesBase;

can the common parts of those enumerations- whether a connection was 
initially established and so on- be moved into a common declaration, 
preferably using "classical" Pascal so that I can store capabilities as 
a set?

-- 
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