def repeated_combination(n)
      return enum_for(:repeated_combination, n) if not block_given?
      if n < 0
        # yield nothing
      elsif n == 0
        yield []
      elsif n == 1
        each { |element| yield [element] }
      elsif @size == 0
        # yield nothing
      else
        combos = lambda do |result,index,remaining|
          while index < @size-1
            if remaining == 1
              yield result.dup << get(index)
            else
              combos[result.dup << get(index), index, remaining-1]
            end
            index += 1
          end
          element = get(index)
          remaining.times { result << element }
          yield result
        end
        combos[[], 0, n]
      end
      return self
    end
def repeated_combination(n)
      return enum_for(:repeated_combination, n) if not block_given?
      if n < 0
        # yield nothing
      elsif n == 0
        yield []
      elsif n == 1
        each { |element| yield [element] }
      elsif @size == 0
        # yield nothing
      else
        combos = lambda do |result,index,remaining|
          while index < @size-1
            if remaining == 1
              yield result.dup << get(index)
            else
              combos[result.dup << get(index), index, remaining-1]
            end
            index += 1
          end
          element = get(index)
          remaining.times { result << element }
          yield result
        end
        combos[[], 0, n]
      end
      return self
    end
When invoked with a block, yields all repeated combinations of length `n` of
 tuples from the `Tuple`, and then returns `self`. A "repeated combination" is
 one in which any tuple from the `Tuple` can appear consecutively any number of
 times.

 There is no guarantee about which order the combinations will be yielded in.

 If no block is given, an `Enumerator` is returned instead.

 @example
   t = Erlang::Tuple[5, 6, 7, 8]
   t.repeated_combination(2) { |c| puts "Combination: #{c}" }

   Combination: [5, 5]
   Combination: [5, 6]
   Combination: [5, 7]
   Combination: [5, 8]
   Combination: [6, 6]
   Combination: [6, 7]
   Combination: [6, 8]
   Combination: [7, 7]
   Combination: [7, 8]
   Combination: [8, 8]
   # => Erlang::Tuple[5, 6, 7, 8]

 @return [self, Enumerator]