That's fair. But I think it's a worthwhile (and fairly minor) complexity to add to the spec to make the language a lot easier to use in some very common use cases. And, I would argue, it actually makes the language slightly more regular, since now &T{v} works for just about everything (possibly everything?).
I'd love to see a bigquery search for variants of declarations of func IntP(i int) *int ... I bet there's a lot of those out there... unless people are really doing &[]int{5}[0] ... which is just horrible. On Friday, October 21, 2016 at 2:53:31 PM UTC-4, Ian Lance Taylor wrote: > > > You are simply defining away the ambiguity by saying that the specific > slice composite literal syntax takes precedence over the &T{v} > translates to (*new(T) = v) syntax. That is a valid approach to take, > but it doesn't mean that there is no ambiguity. And it does mean > additional complexity to the spec and to people's understanding of the > language. > > 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. For more options, visit https://groups.google.com/d/optout.