Hacker News new | ask | show | jobs
by vorg 4366 days ago
> Once something like generics are added

The <> notation in id<T>(item for generic bracketing is harder to read than other bracketing symbols, e.g. () [] and {}. Unlike those others, angles are used for comparison ops and arrow heads also. If Go ever introduces generics, the Scala-like [] notation looks cleaner and would fit into Go's existing grammar.

2 comments

The only point of confusion I can see out of using [] is:

    type Foo[T] T
versus

    type Foo []int
for example.

    type Array[T] []T
Yes please. You'd also avoid some icky non determinism in your parser.