2022-08-19 16:25:42 +12:00
|
|
|
use Outrun.Core.Boolean
|
2022-08-22 11:30:39 +12:00
|
|
|
use LogicalNot
|
2022-08-19 16:25:42 +12:00
|
|
|
|
2022-08-04 17:38:00 +12:00
|
|
|
```doc
|
|
|
|
# Boolean
|
|
|
|
|
|
|
|
Provides a common interface for values masquerading as Booleans.
|
|
|
|
```
|
2022-08-07 16:20:33 +12:00
|
|
|
protocol Boolean, as: do
|
2022-08-04 17:38:00 +12:00
|
|
|
```doc
|
|
|
|
A mechanism for values to convert themselves into a concrete boolean value.
|
|
|
|
|
|
|
|
Must be implemented.
|
|
|
|
```
|
|
|
|
def true?(self: Self): Outrun.Core.Boolean
|
|
|
|
|
|
|
|
```doc
|
|
|
|
Is the value false?
|
|
|
|
```
|
2022-08-22 11:30:39 +12:00
|
|
|
def false?(self: Self): Outrun.Core.Boolean, as: LogicalNot.not(Boolean.true?(self))
|
2022-08-04 17:38:00 +12:00
|
|
|
end
|