Re: [go-nuts] With Go support of Generics I don't sure If interfaces are really about methods (behavior)

2023-02-25 Thread Kamil Ziemian
In the past that was idea to introduce new concept to Go, it was called "contract" if I remember correctly. With it we would write type myNumber contract { int | float64 } Along the way they realize that contracts are just interface with few additions, so we ended where we are. Also it means

Re: [go-nuts] With Go support of Generics I don't sure If interfaces are really about methods (behavior)

2023-02-25 Thread Mohab Alnajjar
Hi Ian, Thanks for your reply. I'm aware of the context of the intensive public discussion you have mentioned. My question is not a criticism of the language as much as an attempt to understand the idea behind Go interfaces and how type elements listing related to that. As Robert Griesemer says:

Re: [go-nuts] With Go support of Generics I don't sure If interfaces are really about methods (behavior)

2023-02-25 Thread Mohab Alnajjar
Interesting. I didn't know that interface with constraint elements can only be used in type parameters. Thanks for your reply. On Saturday, February 25, 2023 at 2:27:42 PM UTC+2 Kamil Ziemian wrote: In the past that was idea to introduce new concept to Go, it was called "contract" if I remember

Re: [go-nuts] With Go support of Generics I don't sure If interfaces are really about methods (behavior)

2023-02-25 Thread Ian Lance Taylor
On Sat, Feb 25, 2023 at 12:29 PM Mohab Alnajjar wrote: > > Hi Ian, Thanks for your reply. > I'm aware of the context of the intensive public discussion you have > mentioned. My question is not a criticism of the language as much as an > attempt to understand the idea behind Go interfaces and how

[go-nuts] overriding image.Decode image type detection

2023-02-25 Thread 'Dan Kortschak' via golang-nuts
I'm implementing a image renderer on an external device and want to include GIF animation support. So far this is working fine, but I've found a difficulty that comes from for image.Decode's file type detection is registered. What I have is shim type that wraps *gif.GIF but also implements image.I