I vaguely remember this exact issue being discussed in some ooc-lang/rock issue but I am basically talking about this kind of stuff:
Comparable: interface {
greater?: func(other: This) -> Bool
lesser?: func(other: This) -> Bool
}
f: func <T: Comparable> (a, b: T, g: Func) {
if (a greater?(b)) {
g()
}
}
Basically, the above would be equivalent to:
f: func (a, b: Comparable, g: Func) {
if (a greater?(b)) {
g()
}
}
But make sure that a, b are of the same type (or have a common root type).
I vaguely remember this exact issue being discussed in some ooc-lang/rock issue but I am basically talking about this kind of stuff:
Basically, the above would be equivalent to:
But make sure that a, b are of the same type (or have a common root type).