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

> but the compiler doesn't understand ...

Right — While it does has sum types, it doesn't have some other features found in other languages.

But, of course, if one wanted those features they would talk about those features. In this discussion, we're talking specifically about sum types, which Go most definitely does have.

> nil -- don't forget nil!

This is why alternative syntax has never been added. Nobody can figure out how to eliminate nil or make it clear that nil is always part of the set in a way that improves upon the current sum types.

 help



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

Search: