have
have copied to clipboard
Builtin interfaces for some language features
Now that the iterator interface has been mentioned in https://github.com/vrok/have/issues/10#issuecomment-251137899 i think it'd be nice to expand that context and make available some language features via interfaces.
For example, equatable:
type equatable[T] interface {
Equals[T](T) bool
}
That would enable this:
if myCustomType == myCustomType2 {
// stuff
}
I'm not convinced about == operator overloading, I think it could hurt readability. I'm not closing the issue yet, I'll need to think about it.