func Permutations(list Replacer, select_num int, repeatable bool, buf int) (c chan Replacer) {
	c = make(chan Replacer, buf)
	go func() {
		defer close(c)
		var perm_generator func([]int, int, int) chan []int
		if repeatable {
			perm_generator = repeated_permutations
		} else {
			perm_generator = permutations
		}
		indices := make([]int, list.Len(), list.Len())
		for i := 0; i < list.Len(); i++ {
			indices[i] = i
		}
		for perm := range perm_generator(indices, select_num, buf) {
			c <- list.Replace(perm)
		}
	}()
	return
}
func Permutations(list Replacer, select_num int, repeatable bool, buf int) (c chan Replacer) {
	c = make(chan Replacer, buf)
	go func() {
		defer close(c)
		var perm_generator func([]int, int, int) chan []int
		if repeatable {
			perm_generator = repeated_permutations
		} else {
			perm_generator = permutations
		}
		indices := make([]int, list.Len(), list.Len())
		for i := 0; i < list.Len(); i++ {
			indices[i] = i
		}
		for perm := range perm_generator(indices, select_num, buf) {
			c <- list.Replace(perm)
		}
	}()
	return
}
//Permutation generator