outrun/outrun-core/lib/equality.outrun

20 lines
503 B
Text

use Any
use Boolean
use LogicalNot
```doc
# Equality
Values which wish to implement the `==` infix operator must implement this protocol.
```
protocol Equality, as: do
```doc
Compare `self` and `other`, returning `true` when the values are equal.
```
def equal?(self: Self, other: Any): Boolean
```doc
Compare `self` and `other`, returning `true` when the values are not equal.
```
def not_equal?(self: Self, other: Any): Boolean, as: LogicalNot.not(Equality.equal?(self, other))
end