On Tue, Jun 16, 2020 at 2:54 PM Alexander Morozov <lk4d4m...@gmail.com> wrote: > > For example consider this example https://play.golang.org/p/rfccpBoFIJN > There is no generics involved, but for person reading the code there will be > additional cognitive load to recognize that it's returned closure call and > not generic function call. > I wonder how could we avoid this confusion (apart from using different > brackets :)). Maybe force type keyword in calls as well to show that those > arguments are types?
Yes, that kind of seeming ambiguity is definitely possible. I think it's an open question whether this kind of code will always be confusing, or whether we can avoid it with style conventions. That is, it's already possible to write confusing code in Go, but people tend to naturally avoid it by choosing names that clarify the intent. Ian -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWjFDno9ZbXRt44RVL5R54Q%2Bxr4bOGw%2B1jXvjN5e_hVwQ%40mail.gmail.com.