Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> A Map [with value type = void/unit/() [0]] and a Set are two different things

Not to defend Go or anything, but that's like saying:

| A Array [with element type = byte/char/u8] and a String are different things

It might be useful to call them different names (of course that would require Go to support generic typedefs for `type Set k = Map k Void`), but they're still fundamentally the same thing.

0: which, to be fair, is not the same thing as a map with bool values.



Fundamentally, all values are a collection of bits. That doesn't mean having distinct structures built on top of those bits isn't useful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: