As a implementation detail, the enum types return which place they were in their declaration. It is better they return 1. This way most enum types can be implemented more efficiently:
Consider this code:
type enum boolean
FALSE = 0,
TRUE
end type
boolean k
? boolean( 5 = 5 )
The code generated for the last line is equivalent to:
? find( 5 = 5, { FALSE, TRUE } )
This is fine for short lists but for long lists its less efficient than:
temp = 5=5
? integer(temp) and FALSE<=temp and temp<=TRUE
changeset: 6211:4be0ecb29c04 branch: alternative_literals tag: tip parent: 6205:825c2da43311 user: Shawn Pringle <shawn.pringle@gmail.com> date: Sun May 18 08:09:36 2014 -0300 files: docs/refman_2.txt source/parser.e tests/manual/t_traced_enum_type.e tests/t_enum_type.e tests/t_literals.e description: