5 ms·
Go's native synonyms of lists, vectors and maps are already "generic", so I'm not sure what your point is.
by personZ 13y ago
Go's native synonyms of lists, vectors and maps are already "generic", so I'm not sure what your point is.
- cgh 13y agoExcept the containers aren't typed. They are essentially containers of void*. If you believe that to be "generic", then you don't understand the topic.
- personZ 13y agoThis is simply wrong, and you clearly don't understand Go (which, as we've amply seen, doesn't stop people from pontificating about it).
- cgh 13y agoYou are right, I overlooked the magic of Go's build-in containers (I admit, I haven't touched the language after we looked at it around a year ago). I amend my comments to apply to user-defined containers and types, where generic == interface{}...at least, it did when we tried the language out. This is an example of a simple "generic" in Go, as I recall it: type mytype struct { mydata interface{} } The casting this requires felt like a step into the past when you're used to eg the STL.