BTW, I am really glad your proposal is accepted, now the whole thing feels polished and IMO it is time to start building an implementation.
пятница, 21 августа 2020 г. в 20:02:17 UTC+3, Carla Pfaff: > On Friday, 21 August 2020 at 16:46:22 UTC+2 bbse...@gmail.com wrote: > >> All constraints except "any" specify a constraint for the type. A >> Stringer constraint will ensure that the type has String() string >> method. "any" is a lack of constraint. > > > The empty interface / any is a constraint that ensures that the type has > at least 0 methods and all of these 0 methods must match the 0 methods of > the interface. An empty purse is still a purse, an empty constraint is > still a constraint. > > >> My problem is the attractiveness of "any" as a return type. >> > > I don't see why anybody would find it attractive as a return type. People > don't use the empty interface because they like it so much, but because Go > doesn't have parametric polymorphism / "generics" yet. There are many > programming languages that have a named top type and it is rarely abused. > Programmers want to write type safe code if they can. > -- 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/137a5799-2bb7-402c-a972-e7da0789c890n%40googlegroups.com.