From a72b7e35d65bca67e978b9c62c815091b4e11f75 Mon Sep 17 00:00:00 2001 From: Kurnia D Win Date: Wed, 29 Aug 2018 22:53:33 +0700 Subject: [PATCH] Updated Go2GenericsFeedback (markdown) --- Go2GenericsFeedback.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Go2GenericsFeedback.md b/Go2GenericsFeedback.md index 2e49c2e9..74b268ab 100644 --- a/Go2GenericsFeedback.md +++ b/Go2GenericsFeedback.md @@ -56,7 +56,7 @@ As the amount of feedback grows, please feel free to organize this page by speci - Russell Johnston: Agreed that it would be great to merge contracts and interfaces. Another way around the operator-naming problem might be to provide some standard interfaces for the operators, with bodies inexpressible in normal Go code. For example, a standard `Multipliable` interface would allow the `*` and `*=` operators, while a standard `Comparable` interface would allow `==`, `!=`, `<`, `<=`, `>=`, and `>`. To express operators with multiple types, these interfaces would presumably need type parameters themselves, for example: `type Multipliable(s Self /* this exists implicitly on all interfaces */, t Other) interface { /* provided by the language */ }`. Then user-written interfaces/contracts could use these standard identifier-based names, neatly sidestepping the issues mentioned in the design document around syntax and types. - Roberto (empijei) Clapis: I agree on this and on the fact that it should be clearer where to use interfaces and where to use contracts. Unifying the two would be great, as they try to address overlapping issues. - - Kurnia D Win: I think `constraint` is better keyword than `contract`. Personally i like `type setter constraint(x T) { x.Set(string) error }` instead of merging with interface. + - Kurnia D Win: I think `constraint` is better keyword than `contract`. Personally i like `type addable constraint(x T, y U) { x + y }` instead of merging with interface. - Hajime Hoshi: I feel like the supposed proposal is too huge to the problems we want to solve listed at https://go.googlesource.com/proposal/+/master/design/go2draft-generics-overview.md . I'm worried this feature would be abused and degrade readability of code. Sorry if I am missing, but the proposal doesn't say anything about `go generate`. Wouldn't `go generate` be enough to the problems?