func NewSet(data ...interface{}) (li *Set) { li = &Set{ list: NewList(), uniq: make(map[interface{}]bool), } li.ValueGetter = util.ValueGetter(li.list.getvalue) li.Extend(data) return }
func NewList(data ...interface{}) (li *List) { li = &List{ list: make([]interface{}, COMFORT_LEN), mutex: &sync.RWMutex{}, caplist: COMFORT_LEN, exlen: COMFORT_LEN, } li.ValueGetter = util.ValueGetter(li.getvalue) li.Extend(data) return }
func NewDict(def interface{}, m ...map[interface{}]interface{}) (d *Dict) { d = &Dict{ dict: make(map[interface{}]interface{}), def: def, mutex: &sync.RWMutex{}, } d.ValueGetter = util.ValueGetter(d.getvalue) for _, mp := range m { d.Update(mp) } return }
func NewOrderedDict(def interface{}, m ...map[interface{}]interface{}) (d *OrderedDict) { d = &OrderedDict{ prevchain: make(map[interface{}]*datachain), def: def, mutex: &sync.RWMutex{}, headchain: &datachain{}, } d.ValueGetter = util.ValueGetter(d.getvalue) for _, mp := range m { d.Update(mp) } return }