On Mon, Jun 22, 2020 at 8:49 AM T L <tapir....@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

-- 
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/CAOyqgcV-i5F_cfsiQ3twwWekrc_xD3tmPcRCYkTrthPcEXTMwQ%40mail.gmail.com.

Reply via email to