Thank you for the feedback.

Regarding the mistake/unintuiveness/error-proneness, IMHO nim users should be 
able to understand and use unordered enums with no problems.

For example C and Python enum numbering requirements are more flexible and are 
not causing major usability or safety issues.

C enums numbering is something like this:
    

  * values order is not required.
  * aliasing is allowed, i.e. multiple fields with the same value is possible.
  * automatic numbering is incremental and is reset each time an item with a 
value is encountered.



That is one known and working way of implementing option1; removing the order 
requirement completely.

Option2 that I implemented, is not full C enum flexibility. It allows unordered 
fields only when all the values are set, so it does not require aliasing and/or 
special automatic numbering. In this case, your example would still be not 
supported by the language and would result in an error.

Reply via email to