News for hackers. Stuff that matters.
Re:Proposal: Go should have generics by sacado2 on Saturday April 16, 2016 @05:06PM (#11512258)
Sum types don't fit well with zero values. What is the zero value of an `(int|string)` union type ?
Re:Proposal: Go should have generics by aninhumer on Saturday April 16, 2016 @10:53PM (#11513294)
Well I don't think zero values are a very good idea to start with (if you want a default value, make it explicit), but if one insists on having them, they can just use the first case. So for your example it would be int 0.