JuliaLang/julia — pull request #2988 by vtjnash (2013-05-01 20:07:08+00:00)
Title: enum bit masks

This introduces a macro `@enum_mask` similar to `@enum`. However, rather than linear indexing, it uses powers of 2, and allows the standard c-style flag / mask manipulations.

```julia
julia> using Enum

julia> @enum_mask A b c d e

julia> A
julia> using Enum

julia> @enum_mask A b c d e

julia> A
enum mask A (b, c, d, e)

julia> b
A(b)

julia> b|c
A(b|c)

julia> ~d
A(b|c|e)
```

Thoughts? Is this the right approach? Should it be turned into a package now?