Conversation

The parens for the type parameters is the one thing Go got right in the entire language.
Quote Tweet
Replying to @omengue @golang and @ianlancetaylor
My main concern is the syntax. Parentheses for type parameters are hard to distinguish from parentheses value parameters. The FAQ mentions that F<T> and F[T] have been considered and rejected. The pain will be on the users to "to keep the parser simple".
2
7
it does mean that you can now have a total of four sets of parens in a function def: func (type T) (s Foo*) Bar(arg1 Baz, arg2 Baz2) (bool, Quux)
1
3
My first instinct is to say "but those aren't the same thing!" but if it's a feature-for-feature trade I'd happily give up interfaces for tagged unions. Can always use records with functions in them instead, they're not even that bad to use.
2
Show replies