I recognize the hefty constraints in introducing generics, but for me the
most egregious part is the cognitive and visual overhead it introduces by
pushing more and more stuff off-screen-right and the processing overhead of
so many sequences of parens on the same line.
My key thought is "the same line".
Could I suggest, to convert an extension of the 'type' construct:
````go
func divide(a, b int) (int, error) {
if b == 0 {
return 0, DivideByZero
}
return a/b
}
```
becomes
```go
type divide generic { type V, type D }
func divide(a V, b D) (int, error) {
...
}
```
and potentially the ability to be selective about types:
type divide generic { type V union { type int, type uint, type float },
type D }
func divide ...
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/ef88da06-f993-4d98-a4ac-81e79b1fe775n%40googlegroups.com.