[go-nuts] Re: Building a select friendly condition type

2017-11-30 Thread Steven Harris
On Thursday, November 30, 2017 at 12:32:10 AM UTC-5, Dave Cheney wrote: > > But I'm wondering if others have found themselves in the same position, > and if so, what were your solutions? > I'm not sure if this approach satisfies all of your requirements, but if you want those registering to be n

[go-nuts] Constraining a type parameter to implement an interface via pointer receiver

2022-03-28 Thread Steven Harris
I am working with a family of types that integrate with an existing Go project that follow a couple of patterns, and I'd like to manipulate them uniformly by introducing a generic function. My example uses a contrived, whittled-down set of struct fields and interfaces to demonstrate the challen

[go-nuts] Re: Constraining a type parameter to implement an interface via pointer receiver

2022-03-28 Thread Steven Harris
> > Should it be possible to write a type constraint that would allow me to > eliminate this projection function parameter, and instead have the compiler > mandate and ensure that for a given type E, the related type *E > implements Object? > I realized that this desire may be addressed by the

[go-nuts] Re: Constraining a type parameter to implement an interface via pointer receiver

2022-03-28 Thread Steven Harris
In parallel discussion in the "generics" channel of the "Gophers" Slack workspace, Roger Peppe was kind enough to point me to an example of the structural type constraint