Simplified Equality
Some checks failed
Build / build (push) Successful in 10m48s
Test / build (push) Failing after 17m11s

This commit is contained in:
Chuck Smith
2024-03-24 17:11:48 -04:00
parent fea9fb9f64
commit 1c99d2198b
11 changed files with 109 additions and 133 deletions

View File

@@ -5,16 +5,18 @@ type Null struct{}
func (n *Null) Type() ObjectType {
return NULL_OBJ
}
func (n *Null) Inspect() string {
return "null"
}
func (n *Null) String() string {
return n.Inspect()
}
func (n *Null) Equal(other Object) bool {
_, ok := other.(*Null)
return ok
}
func (n *Null) Less(other Object) bool {
return false
func (n *Null) Compare(other Object) int {
if _, ok := other.(*Null); ok {
return 0
}
return 1
}