array builtins
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user