4 ms·
I see they went with []. Scala does this and it annoys me because [] also denotes arrays. Unlike <> which doesn't have any overloaded meaning.
by fnord77 5y ago
I see they went with []. Scala does this and it annoys me because [] also denotes arrays. Unlike <> which doesn't have any overloaded meaning.
- Jtsummers 5y agoThey wrote about the syntax a while back, one reason they avoided <> is that they lack parse-time type information to properly differentiate between certain cases like: a,b := w < x, y > (z) There are two valid parsings of that if generics use <> and at parse time it isn't known which one to use. Either: a, b := [boolean expression w < x], [boolean expression y > (z)] or a, b := [generic function w] [with parameters <x,y>] [applied to (z)] https://groups.google.com/g/golang-nuts/c/7t-Q2vt60J8 https://groups.google.com/g/golang-nuts/c/7t-Q2vt60J8