[generics] Angle brackets for generics?

103 views
Skip to first unread message

Павел Кошелев

unread,
Jun 18, 2020, 12:38:53 PM6/18/20
to golan...@googlegroups.com
Hello, I think, that default brackets will make code much less understandable. I'm suggesting to use angle brackets instead and omit the "type" word.

For example, following function seems much more succinct for me: func Print<T> (s []T) {}

Ian Lance Taylor

unread,
Jun 18, 2020, 9:53:28 PM6/18/20
to Павел Кошелев, golang-nuts
On Thu, Jun 18, 2020 at 9:38 AM Павел Кошелев <pave...@gmail.com> wrote:
>
> Hello, I think, that default brackets will make code much less understandable. I'm suggesting to use angle brackets instead and omit the "type" word.
>
> For example, following function seems much more succinct for me: func Print<T> (s []T) {}

https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#why-not-use-the-syntax-like-c_and-java

https://groups.google.com/d/msg/golang-nuts/Rumm5HFhg_Q/baIq7eDgBgAJ

Ian
Reply all
Reply to author
Forward
0 new messages