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
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:
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
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
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