optimizations
This commit is contained in:
@@ -57,11 +57,6 @@ func (t Type) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
// Comparable is the interface for objects to implement suitable comparisons
|
||||
type Comparable interface {
|
||||
Compare(other Object) int
|
||||
}
|
||||
|
||||
// Copyable is the interface for creating copies of objects
|
||||
type Copyable interface {
|
||||
Copy() Object
|
||||
@@ -73,9 +68,14 @@ type Object interface {
|
||||
fmt.Stringer
|
||||
Type() Type
|
||||
Bool() bool
|
||||
Compare(Object) int
|
||||
Inspect() string
|
||||
}
|
||||
|
||||
type BaseObject struct{}
|
||||
|
||||
func (o BaseObject) Compare(other Object) int { return -1 }
|
||||
|
||||
// Hasher is the interface for objects to provide suitable hash keys
|
||||
type Hasher interface {
|
||||
Hash() HashKey
|
||||
|
||||
Reference in New Issue
Block a user