Files
dolt/types/value.go
Erik Arvidsson 58464baef9 Total ordering of values (#1475)
This allows having a set/map of heterogenous elements/keys. To support
this we have to be able to have a total ordering for all noms values.

The ordering is false < true < -999 < 0 < 999 < "" < "a" < "z" < Hash
In other words, Bool < Number < String < * and for comparing non
primitives we compare the hash of the object.

Fixes #1104
Fixes #1312
2016-05-12 10:35:56 -07:00

18 lines
340 B
Go

package types
import (
"github.com/attic-labs/noms/ref"
)
// Value is implemented by every noms value
type Value interface {
Equals(other Value) bool
Less(other Value) bool
Ref() ref.Ref
// Returns the immediate children of this value in the DAG, if any, not including Type().
ChildValues() []Value
Chunks() []Ref
Type() *Type
}