func (d *Dict) Values() []interface{} {
	if d.IsEmpty() {
		return nil
	}
	values := make([]interface{}, d.size)
	for i, key := range d.keys {
		values[i] = d.values[key.ID]
	}
	return values
}
Values returns a slice of all dict values, or nil if dict is empty.
package dict
type Dict struct {
	size, version int
	keys          []*Key
	values        map[uint64]interface{}
}
func (d *Dict) Version() int { return d.version }
func (d *Dict) Len() int { return d.size }
func New(vargs ...interface{}) *Dict {
	d := &Dict{values: make(map[uint64]interface{})}
	d.Update(vargs...)
	return d
}
func (d *Dict) Set(key, value interface{}) *Dict {
	if d == nil {
		d = New()
	}
	k := MakeKey(key)
	if k == nil {
		return d
	}
	if _, ok := d.values[k.ID]; ok {
		d.values[k.ID] = value
		return d
	}
	d.keys = append(d.keys, k)
	d.values[k.ID] = value
	d.size++
	d.version++
	return d
}
func (d *Dict) Get(key interface{}, alt ...interface{}) interface{} {
	if d.IsEmpty() {
		return nil
	}
	h, ok := d.GetKeyID(key)
	if ok {
		return d.values[h]
	}
	if alt != nil {
		return alt[0]
	}
	return nil
}
func (d *Dict) GetKeyID(key interface{}) (uint64, bool) {
	if d.IsEmpty() {
		return 0, false
	}
	k := MakeKey(key)
	if k == nil {
		return 0, false
	}
	_, ok := d.values[k.ID]
	return k.ID, ok
}
func (d *Dict) deleteItem(idx int) {
	if d.IsEmpty() || idx >= d.size {
		return
	}
	delete(d.values, d.keys[idx].ID)
	copy(d.keys[idx:], d.keys[idx+1:])
	l := len(d.keys)
	d.keys[l-1] = nil
	d.keys = d.keys[:l-1]
	d.size = l
	d.version++
}
func (d *Dict) Del(key interface{}) bool {
	id, ok := d.GetKeyID(key)
	if !ok {
		return false
	}
	var idx int
	for i := range d.keys {
		if d.keys[i].ID == id {
			idx = i
			break
		}
	}
	if idx > d.size || d.keys[idx].ID != id {
		return false
	}
	d.deleteItem(idx)
	return true
}
func (d *Dict) Pop(key interface{}, alt ...interface{}) interface{} {
	value := d.Get(key, alt)
	if value != nil {
		d.Del(key)
	}
	return value
}
func (d *Dict) PopItem() *Item {
	if d.IsEmpty() {
		return nil
	}
	key := d.keys[d.size-1]
	value := d.values[key.ID]
	d.deleteItem(d.size - 1)
	return &Item{
		Key:   key.Name,
		Value: value,
	}
}
func (d *Dict) Key(key interface{}) bool {
	_, ok := d.GetKeyID(key)
	return ok
}
func (d *Dict) IsEmpty() bool {
	return d == nil || d.size == 0
}
func (d *Dict) Clear() bool {
	if d.IsEmpty() {
		return false
	}
	d.size = 0
	d.version++  
	d.keys = []*Key{}
	d.values = make(map[uint64]interface{})
	return true
}
func (d *Dict) Keys() []string {
	if d.IsEmpty() {
		return nil
	}
	keys := make([]string, d.size)
	for i := range d.keys {
		keys[i] = d.keys[i].Name
	}
	return keys
}