On Tue, Jun 23, 2020 at 8:34 AM T L <tapir....@gmail.com> wrote: > > On Monday, June 22, 2020 at 1:25:33 PM UTC-4, Ian Lance Taylor wrote: >> >> On Mon, Jun 22, 2020 at 8:49 AM T L <tapi...@gmail.com> wrote: >> > >> > One example is the above Print function example. >> > Another example I current get is to iterate and print >> > all the key and values of a container in a current format. >> > There should be more examples with this need I think. >> >> I want to stress that we want real examples of real code that people >> want to write, not theoretical ideas for code that people might in >> theory want to write. >> >> Do you have a real program that uses both slices and maps where you >> would want to have a generic function that prints the keys and values >> of either a slice or map? When does that come up? When I ask that, >> I'm looking for a real program, not the idea that somebody somewhere >> might want to do that. I agree that somebody somewhere might want to >> do that. But is it an important enough use case that we must handle >> it in the first attempt at adding generics to the language? When >> thinking about that, consider that one goal of generics is to permit >> people to write their own container types, which will by definition >> not be maps or slices. Should we be looking for some mechanism that >> can print the keys and values of any container type? Why is it >> important to handle the cases of slices or maps but not the case of >> other container types? >> >> Ian > > > I think this is a problem whether or not long tail matters for the generic > design. > It might affect user happiness, I think, but it is hard to predict.
It seems to me that we do not have to handle the entire long tail in the first version of generics. Perhaps I am wrong about that. 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/CAOyqgcWv9Ef1Z7G-MRV29kEmaRkR0sJy7mWix7zsFRyJLcbqMA%40mail.gmail.com.