+1 On Monday, February 19, 2018 at 12:37:14 PM UTC-5, Michael Jones wrote: > > Matthew Juran wrote: *"...but if you use maps, slices, append, make, you > are already using generics."* > > This seems deeply insightful to me. Perhaps a better question than the > self-defeatingly open question of "how should Go embrace generics?" would > be "what change would allow maps, slices, append, and make to be > implemented as user code in Go 2?" > > On Mon, Feb 19, 2018 at 8:53 AM, <matthe...@gmail.com <javascript:>> > wrote: > >> I would probably never use it, like many people who comes to Go from C. >> >> >> But if you use maps, slices, append, make, you are already using generics. >> >> Maybe this is unfounded, but I'm far from convinced that generics would >>> make my experience of Go better. I'm really thinking here of, are we really >>> sure they would make large unfamiliar codebases more comprehensible? Every >>> feature of a language can be abused, so are they worth the abuse that they >>> would allow? >> >> >> Sometimes having another built-in function would be helpful, and generics >> would provide a way to write those without changing the compiler. What I’ve >> seen is that built-in functions and new types expanding on the map/slice >> pattern will not make it into Go 2 without a major reason. >> >> The other call for generics is interface{}. The Go 1 uses of interface{} >> can make strange code that maybe would be more comprehensible another way. >> >> Matt >> >> On Monday, February 19, 2018 at 9:50:53 AM UTC-6, Henrik Johansson wrote: >>> >>> I disagree that generics would decrease readability at the call site. >>> Perhaps within the library where it is used but maybe not even there. The >>> only complexity is within the compiler and other internals. This is not >>> irrelevant by far but the carte blanche "generics is bad" is most often >>> hyperbole. >>> >>> I can also "do without" generics and in fact even though Go lacks it I >>> prefer Go to all other languages that I know. I still would appreciate a >>> generics version in Go's spirit. >>> >>> On Mon, Feb 19, 2018, 16:06 Ignazio Di Napoli <necl...@gmail.com> wrote: >>> >>>> >>>> On Monday, February 19, 2018 at 4:04:12 PM UTC+1, Ignazio Di Napoli >>>> wrote: >>>>> >>>>> data2 := found.(float32) // THIS PANICS AT RUNTIME, data2 is int >>>>> >>>> >>>> Sorry, found is int. >>>> >>>> -- >>>> 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. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> 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 <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Michael T. Jones > michae...@gmail.com <javascript:> >
-- 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.