Open erizocosmico opened 8 years ago
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.
iterator
For example, equatable:
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.
==
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
:That would enable this: