func (l *list) Chan(n int) <-chan interface{} {
	ch := make(chan interface{})
	go func() {
		for iter := l.Iter(); iter != nil; iter = iter.Next() {
			ch <- iter.Get()
		}
		close(ch)
	}()
	return ch
}
Chan returns a channel which iterates from the front to the back of the list
package unrolledlinkedlist
import (
	"errors"
	List "github.com/zimmski/container/list"
)
type node struct {
	next     *node          
	previous *node          
	values   []interface{}  
}
type iterator struct {
	current *node  
	i       int    
}
func (iter *iterator) Next() List.Iterator {
	iter.i++
	if iter.current != nil && iter.i >= len(iter.current.values) {
		iter.i = 0
		iter.current = iter.current.next
	}
	if iter.current == nil {
		return nil
	}
	return iter
}
func (iter *iterator) Previous() List.Iterator {
	iter.i--
	if iter.current != nil && iter.i < 0 {
		iter.current = iter.current.previous
		if iter.current != nil {
			iter.i = len(iter.current.values) - 1
		}
	}
	if iter.current == nil {
		return nil
	}
	return iter
}
func (iter *iterator) Get() interface{} {
	return iter.current.values[iter.i]
}
func (iter *iterator) Set(v interface{}) {
	iter.current.values[iter.i] = v
}
type list struct {
	first       *node  
	last        *node  
	maxElements int    
	len         int    
}
func New(maxElements int) *list {
	if maxElements < 1 {
		panic("maxElements must be at least 1")
	}
	l := new(list)
	l.Clear()
	l.maxElements = maxElements
	return l
}
func (l *list) Clear() {
	i := l.first
	for i != nil {
		j := i.next
		i.next = nil
		i.previous = nil
		i.values = nil
		i = j
	}
	l.first = nil
	l.last = nil
	l.len = 0
}
func (l *list) Len() int {
	return l.len
}
func (l *list) Empty() bool {
	return l.len == 0
}
func (l *list) insertElement(v interface{}, c *node, ic int) {
	if c == nil || ic == 0 || len(c.values) == 0 {  
		n := l.insertNode(c, false)
		n.values = append(n.values, v)
	} else if len(c.values) == ic {  
		n := c
		if len(n.values) == cap(n.values) {
			n = l.insertNode(c, true)
			if l.maxElements > 3 {
				ic = (len(c.values) + 1) / 2
				n.values = append(n.values, c.values[ic:len(c.values)]...)
				c.values = c.values[:ic]
			}
		}
		n.values = append(n.values, v)
	} else {  
		n := l.insertNode(c, true)
		n.values = append(n.values, c.values[ic:len(c.values)]...)
		c.values[ic] = v
		c.values = c.values[:ic+1]
	}
	l.len++
}
func (l *list) removeElement(c *node, ic int) interface{} {
	v := c.values[ic]
	for ; ic < len(c.values)-1; ic++ {
		c.values[ic] = c.values[ic+1]
	}
	c.values = c.values[:len(c.values)-1]
	l.len--
	if len(c.values) == 0 {
		l.removeNode(c)
	} else if n := c.next; l.maxElements > 3 && n != nil && len(c.values) < l.maxElements/2 {
		if len(n.values)-2 < l.maxElements/2 {  
			for _, v := range n.values {
				c.values = append(c.values, v)
			}
			l.removeNode(n)
		} else {  
			c.values = append(c.values, n.values[0], n.values[1])
			for ic = 2; ic < len(n.values); ic++ {
				n.values[ic-2] = n.values[ic]
			}
			n.values = n.values[:len(n.values)-2]
		}
	}
	return v
}
func (l *list) newNode() *node {
	return &node{
		values: make([]interface{}, 0, l.maxElements),
	}
}
func (l *list) getNode(i int) (*node, int) {
	for c := l.first; c != nil; c = c.next {
		if i < len(c.values) {
			return c, i
		}
		i -= len(c.values)
	}
	return nil, -1
}
func (l *list) insertNode(p *node, after bool) *node {
	n := l.newNode()
	if l.len == 0 {
		l.first = n
		l.last = n
	} else if after {
		n.next = p.next
		if p.next != nil {
			p.next.previous = n
		}
		p.next = n
		n.previous = p
		if p == l.last {
			l.last = n
		}
	} else {
		if p == l.first {
			l.first = n
		} else {
			if p.previous != nil {
				p.previous.next = n
				n.previous = p.previous
			}
		}
		n.next = p
		p.previous = n
	}
	return n
}
func (l *list) removeNode(c *node) *node {
	if c == l.first {
		l.first = c.next
		if c.next != nil {
			c.next.previous = nil
		}
		if c == l.last {
			l.last = nil
		}
	} else {
		if c.previous != nil {
			c.previous.next = c.next
			if c.next != nil {
				c.next.previous = c.previous
			} else if c == l.last {
				l.last = c.previous
			}
		}
	}
	c.next = nil
	c.previous = nil
	c.values = nil
	return c
}
func (l *list) newIterator(current *node, i int) *iterator {
	return &iterator{
		i:       i,
		current: current,
	}
}