On Sat, 15 Aug 2020 at 04:57, Patrick Smith <pat42sm...@gmail.com> wrote:

> On Thu, Aug 13, 2020 at 11:25 PM Patrick Smith <pat42sm...@gmail.com>
> wrote:
> > I tried out a few different implementations, evaluating the polynomial
> > instead of finding roots,
> > at https://go2goplay.golang.org/p/g8bPHdg5iMd . As far as I can tell,
> > there is no sensible way to
> > do it with an interface that is implemented directly by *big.Float; we
> > need to wrap *big.Float
> > in a wrapper type in any case.
>
> After looking at the draft again, and seeing the Settable example
> there, I realized we can do it using big.Float directly, but it needs
> two interfaces, one matching big.Float and one matching *big.Float. I
> have updated my examples at https://go2goplay.golang.org/p/auSkvhWSNHn


I think that works pretty well, and seems to be the direction that things
are going in.
Here's your example cleaned up a bit to show just that latest example, and
also
showing how it looks when adapting a built-in type:

    https://go2goplay.golang.org/p/eFIvHocOC75

It's possible to build a generic adaptor type from the value-style
interface to the pointer-style interface, which you might find interesting:

  https://go2goplay.golang.org/p/NiQY_-kWvu8

This could *almost* work on image.Point, except that Point.Mul has the
wrong signature.

  cheers,
    rog.

>
> .
>
> --
> 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/CAADvV_vxU7nUJ16X5xwBYhiOPVrzp%3DzrX%3DU4UTgBsOQJ2RnMuQ%40mail.gmail.com
> .
>

-- 
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/CAJhgacgn3maKUvpRV8U1Pe7K2RrOiDBgHVvu6DYwAgNgYs%2BCNA%40mail.gmail.com.

Reply via email to