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 <javascript:>> 
> 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.

-- 
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/8ecb0b0a-64e1-4713-b92e-d203f76800ffo%40googlegroups.com.

Reply via email to