func (l *List) equals(o types.IterableContainer) bool { if l.Size() != o.Size() { return false } for v, next := l.Items()(); next != nil; v, next = next() { item := v.(types.Hashable) if !o.Has(item) { return false } } return true }
func (l *List) less(o types.IterableContainer) bool { if l.Size() < o.Size() { return true } else if l.Size() > o.Size() { return false } cs, si := l.Items()() co, oi := o.Items()() for si != nil || oi != nil { if cs.Less(co) { return true } else if !cs.Equals(co) { return false } cs, si = si() co, oi = oi() } return false }