def lookup(lookup_variants, lookup_invocation)
      case lookup_variants.size
      when 0
        throw :no_such_key
      when 1
        merge_single(yield(lookup_variants[0]))
      else
        lookup_invocation.with(:merge, self) do
          result = lookup_variants.reduce(NOT_FOUND) do |memo, lookup_variant|
            not_found = true
            value = catch(:no_such_key) do
              v = yield(lookup_variant)
              not_found = false
              v
            end
            if not_found
              memo
            else
              memo.equal?(NOT_FOUND) ? convert_value(value) : merge(memo, value)
            end
          end
          throw :no_such_key if result == NOT_FOUND
          lookup_invocation.report_result(result)
        end
      end
    end
def lookup(lookup_variants, lookup_invocation)
      case lookup_variants.size
      when 0
        throw :no_such_key
      when 1
        merge_single(yield(lookup_variants[0]))
      else
        lookup_invocation.with(:merge, self) do
          result = lookup_variants.reduce(NOT_FOUND) do |memo, lookup_variant|
            not_found = true
            value = catch(:no_such_key) do
              v = yield(lookup_variant)
              not_found = false
              v
            end
            if not_found
              memo
            else
              memo.equal?(NOT_FOUND) ? convert_value(value) : merge(memo, value)
            end
          end
          throw :no_such_key if result == NOT_FOUND
          lookup_invocation.report_result(result)
        end
      end
    end
Merges the result of yielding the given _lookup_variants_ to a given block.

 @param lookup_variants [Array] The variants to pass as second argument to the given block
 @return [Object] the merged value.
 @yield [} ]
 @yieldparam variant [Object] each variant given in the _lookup_variants_ array.
 @yieldreturn [Object] the value to merge with other values
 @throws :no_such_key if the lookup was unsuccessful

 Merges the result of yielding the given _lookup_variants_ to a given block.

 @param lookup_variants [Array] The variants to pass as second argument to the given block
 @return [Object] the merged value.
 @yield [} ]
 @yieldparam variant [Object] each variant given in the _lookup_variants_ array.
 @yieldreturn [Object] the value to merge with other values
 @throws :no_such_key if the lookup was unsuccessful