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