Files
monkey/internal/object/null.go
Chuck Smith 12d43c9835
Some checks failed
Publish Image / publish (push) Waiting to run
Test / build (push) Waiting to run
Build / build (push) Has been cancelled
Refactor Type to be an int
2024-03-29 11:01:15 -04:00

27 lines
341 B
Go

package object
type Null struct{}
func (n *Null) Bool() bool {
return false
}
func (n *Null) Type() Type {
return NullType
}
func (n *Null) Inspect() string {
return "null"
}
func (n *Null) String() string {
return n.Inspect()
}
func (n *Null) Compare(other Object) int {
if _, ok := other.(*Null); ok {
return 0
}
return 1
}