array builtins
Some checks failed
Build / build (push) Successful in 14m31s
Test / build (push) Failing after 17m13s

This commit is contained in:
Chuck Smith
2024-03-24 16:29:18 -04:00
parent 3c66b980e7
commit fea9fb9f64
13 changed files with 197 additions and 34 deletions

View File

@@ -26,3 +26,16 @@ func (b *Boolean) Equal(other Object) bool {
}
return false
}
func (b *Boolean) Int() int64 {
if b.Value {
return 1
}
return 0
}
func (b *Boolean) Less(other Object) bool {
if obj, ok := other.(*Boolean); ok {
return b.Int() < obj.Int()
}
return false
}