Agreed. I had proposed a different approach, where the built-in map and slice could have alternative implementations chosen during make(). 95% of generics usage is collections. I think this would have retained the simplicity of Go a bit better than generics - but at the end of day - generics are not “difficult". Bad programmers write bad code without generics.
> On Dec 30, 2020, at 5:15 PM, Amnon <amno...@gmail.com> wrote: > > I would like a type-safe version of sync.Map(). > > > On Wednesday, 30 December 2020 at 23:02:48 UTC ren...@ix.netcom.com wrote: > I don't know how Go users can be ‘anti interface’ - literally 95% of the > stdlib is based on interfaces. If you use the stdlib, you use interfaces. > > >> On Dec 30, 2020, at 9:44 AM, Jesper Louis Andersen <jesper.lou...@gmail.com >> <applewebdata://855D994B-0514-4139-8577-9F7CD76D8029>> wrote: >> > >> On Wed, Dec 30, 2020 at 3:37 PM Jan Mercl <0xj...@gmail.com >> <applewebdata://855D994B-0514-4139-8577-9F7CD76D8029>> wrote: >> >> Don't get me wrong. No doubt there are use cases which cannot be >> solved reasonably without generics. No doubt there are many other >> cases where generics will be an elegant and still readable solution >> either. >> >> >> I don't disagree on this view. More expressive power in a language is also >> more power to make incomprehensible APIs. I've seen my fair share of >> interface-heavy APIs which shouldn't have used interfaces in the first place, >> or should have been placed at a different layer of abstraction. >> >> I've also seen my fair share of Haskell code where the problem is also >> present. >> >> -- >> J. >> > >> -- >> 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...@googlegroups.com >> <applewebdata://855D994B-0514-4139-8577-9F7CD76D8029>. > >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/CAGrdgiX6CdGPx76z-QZ3jz-Rr8E-LX36%2B%2BD8p_fh5HF1CnUh%2Bg%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/golang-nuts/CAGrdgiX6CdGPx76z-QZ3jz-Rr8E-LX36%2B%2BD8p_fh5HF1CnUh%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer>. > > > -- > 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 > <mailto:golang-nuts+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/483c3f92-097e-4954-b4df-135b6ab561e4n%40googlegroups.com > > <https://groups.google.com/d/msgid/golang-nuts/483c3f92-097e-4954-b4df-135b6ab561e4n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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/00594B09-CB09-43F5-9ECA-328E2016846A%40ix.netcom.com.