id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 269,Add Enum handling features,hopscc,,"1) Add a capability to the declaration of a cobra enum to specify that they have the 'Flag' attribute and their members are automatically initialised to bitset values Suggestion was an attribute '!BitSetFlag' or '!AutoBitSetFlag' {{{ #!cobra enum Colors has AutoBitSetFlag None, Red, Green, Blue, Yellow # which would generate code equivalent to the explicitly detailed enum Colors has Flag None = 0, Red = 1, Green = 2, Blue = 4, Yellow = 8 }}} ( member values start from 0 and double (per a bitset setting) for each successive value) 2) Overload the processing for an 'in' expression so that 'in' on an enum value and combined bitset gets converted to a valid set inclusion test optimised for whether the enum is a bitset or not e.g. {{{ #!cobra primaries = Colors(Red,Green, Blue) c = .getColor if c in primaries }}} gets converted to the equivalent of {{{ #!cobra if primaries.hasFlags(c) # c & primaries == c }}} if Colors is declared as a bitset with Flags (either explicitly or as above) and {{{ #!cobra if c in Set([Colors.Red, Colors.Green, Colors.Blue]) }}} if not See ticket:265 ",enhancement,new,minor,,Cobra Compiler,0.8.0,,,