Aaron

> come again... The set size is a bit field with 1 bit for each element
padded
> out to the nearest 8 bits.  hence a set for a 13 element enumeration is 13
bits
> but is stored in 16bits... This has absolutely nothing to do with type
safety.

Where do you get this from?

I would have thought (and you will correct me) that

  MySet = (chris, john, bob, mary, fred, pam);  is 6 enumerations
  MyXSet =  set of MySet; is a set of 6 possible elements (make sense to
store as a byte or Word)
 x := [chris, pam, mary]; sets bits 1,4,6 *not packed* in x.
 y := [chris]                       sets bit 1 in y

which is why union operators are fast as they are single Op Codes

Ord(x) = 1 + 8 + 32 = 41
Ord(y)  = 1

Makes sense but as a set can be up to 256 bits it is not universal

Regards
Neven



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to