def fetch(index, default = (missing_default = true))
      if index >= -@size && index < @size
        return get(index)
      elsif block_given?
        return Erlang.from(yield(index))
      elsif !missing_default
        return Erlang.from(default)
      else
        raise IndexError, "index #{index} outside of tuple bounds"
      end
    end
def fetch(index, default = (missing_default = true))
      if index >= -@size && index < @size
        return get(index)
      elsif block_given?
        return Erlang.from(yield(index))
      elsif !missing_default
        return Erlang.from(default)
      else
        raise IndexError, "index #{index} outside of tuple bounds"
      end
    end
Retrieve the value at `index` with optional default.

 @overload fetch(index)
   Retrieve the value at the given index, or raise an `IndexError` if not
   found.

   @param index [Integer] The index to look up
   @raise [IndexError] if index does not exist
   @example
     t = Erlang::Tuple["A", "B", "C", "D"]
     t.fetch(2)       # => "C"
     t.fetch(-1)      # => "D"
     t.fetch(4)       # => IndexError: index 4 outside of tuple bounds

 @overload fetch(index) { |index| ... }
   Retrieve the value at the given index, or return the result of yielding
   the block if not found.

   @yield Once if the index is not found.
   @yieldparam [Integer] index The index which does not exist
   @yieldreturn [Object] Default value to return
   @param index [Integer] The index to look up
   @example
     t = Erlang::Tuple["A", "B", "C", "D"]
     t.fetch(2) { |i| i * i }   # => "C"
     t.fetch(4) { |i| i * i }   # => 16

 @overload fetch(index, default)
   Retrieve the value at the given index, or return the provided `default`
   value if not found.

   @param index [Integer] The index to look up
   @param default [Object] Object to return if the key is not found
   @example
     t = Erlang::Tuple["A", "B", "C", "D"]
     t.fetch(2, "Z")  # => "C"
     t.fetch(4, "Z")  # => "Z"

 @return [Object]