func (l *list) IterBack() List.Iterator {
	if l.len == 0 {
		return nil
	}
	return l.newIterator(l.last)
}
IterBack returns an iterator which starts at the back of the list, or nil if there are no elements in the list
package doublylinkedlist
import (
	"errors"
	List "github.com/zimmski/container/list"
)
type node struct {
	next     *node        
	previous *node        
	value    interface{}  
}
type iterator struct {
	current *node  
}
func (iter *iterator) Next() List.Iterator {
	if iter.current != nil {
		iter.current = iter.current.next
	}
	if iter.current == nil {
		return nil
	}
	return iter
}
func (iter *iterator) Previous() List.Iterator {
	if iter.current != nil {
		iter.current = iter.current.previous
	}
	if iter.current == nil {
		return nil
	}
	return iter
}
func (iter *iterator) Get() interface{} {
	return iter.current.value
}
func (iter *iterator) Set(v interface{}) {
	iter.current.value = v
}
type list struct {
	first *node  
	last  *node  
	len   int    
}
func New() *list {
	l := new(list)
	l.Clear()
	return l
}
func (l *list) Clear() {
	i := l.first
	for i != nil {
		j := i.next
		i.next = nil
		i.previous = 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) newNode(v interface{}) *node {
	return &node{
		value: v,
	}
}
func (l *list) getNode(i int) (*node, error) {
	if i > -1 && i < l.len {
		j := 0
		for n := l.first; n != nil; n = n.next {
			if i == j {
				return n, nil
			}
			j++
		}
	}
	return nil, errors.New("index bounds out of range")
}
func (l *list) insertNodeBefore(v interface{}, p *node) *node {
	n := l.newNode(v)
	if l.len == 0 {
		l.first = n
		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
	}
	l.len++
	return n
}
func (l *list) removeNode(c *node) interface{} {
	if c == nil || l.len == 0 {
		return nil
	}
	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
	l.len--
	return c.value
}
func (l *list) newIterator(current *node) *iterator {
	return &iterator{
		current: current,
	}
}
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
}
func (l *list) ChanBack(n int) <-chan interface{} {
	ch := make(chan interface{})
	go func() {
		for iter := l.IterBack(); iter != nil; iter = iter.Previous() {
			ch <- iter.Get()
		}
		close(ch)
	}()
	return ch
}
func (l *list) Iter() List.Iterator {
	if l.len == 0 {
		return nil
	}
	return l.newIterator(l.first)
}