have icon indicating copy to clipboard operation
have copied to clipboard

Builtin interfaces for some language features

Open erizocosmico opened this issue 9 years ago • 1 comments

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
}

erizocosmico avatar Oct 03 '16 15:10 erizocosmico

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.

vrok avatar Oct 25 '16 10:10 vrok