mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-12 02:58:53 -06:00
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
18 lines
340 B
Go
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
|
|
}
|