Right now macros are organized in an immutable array, but it can be helpful to look them up by name without just evaluating them blindly.
We should consider providing a lazily-created ImmutableDictionary of them in addition to the array.
This came up when manually translating PortAudio's macro-style enums, which do not have identifying prefixes and had to be listed manually. (EG: PaSampleFormat)
On the flip side however, it might be kinda non-obvious why we offer both (iterating an array is valuable for certain libraries, IE: Win32.) Maybe the dictionary should only be internal?
Right now macros are organized in an immutable array, but it can be helpful to look them up by name without just evaluating them blindly.
We should consider providing a lazily-created
ImmutableDictionary
of them in addition to the array.This came up when manually translating PortAudio's macro-style enums, which do not have identifying prefixes and had to be listed manually. (EG:
PaSampleFormat
)On the flip side however, it might be kinda non-obvious why we offer both (iterating an array is valuable for certain libraries, IE: Win32.) Maybe the dictionary should only be internal?