Hacker News new | ask | show | jobs
by RyanCavanaugh 3285 days ago
If you want to have the reverse map, you can trivially build it yourself. But if the reverse map did exist (rather, if the map started off as bidirectional, which is the only option on the table), it'd be impossible to properly construct the one-way map.
1 comments

You mean because of using the same string for a key/value? I guess I see the potential problem. Anyway just think that it might be a bit confusing to have the enum work slightly different depending on whether its using numbers or strings. It can caught some people off guard.