def list(name,
             loader = nil,
             enforce_element: @enforce_all_elements,
             enforce_values: true,
             exact_count: nil,
             max_count: nil,
             min_count: nil,
             required: nil,
             with_elements: false)

      enforce_element = required unless required.nil?
      enforce_element ||= exact_count && exact_count > 0 || min_count && min_count > 0
      loader = Proc.new if block_given?

      @touched = true

      unless @elements_associative.key?(name)
        if enforce_element
          raise Errors::Validation.missing_list(@context, name, @instruction)
        end

        return []
      end

      elements = @elements_associative[name]

      elements.each do |element|
        case element
        when List, Empty
          next
        when Field
          raise Errors::Validation.expected_list_got_field(@context, element.instruction)
        when Fieldset
          raise Errors::Validation.expected_list_got_fieldset(@context, element.instruction)
        when Section
          raise Errors::Validation.expected_list_got_section(@context, element.instruction)
        end
      end

      if elements.length > 1
        raise Errors::Validation.expected_list_got_lists(
          @context,
          name,
          elements.map(&:instruction)
        )
      end

      element = elements[0]
      element.touch

      count = element.is_a?(Empty) ? 0 : element.length

      if exact_count && count != exact_count
        raise Errors::Validation.exact_count_not_met(@context, element.instruction, exact_count)
      end

      if min_count && count < min_count
        raise Errors::Validation.min_count_not_met(@context, element.instruction, min_count)
      end

      if max_count && count > max_count
        raise Errors::Validation.max_count_not_met(@context, element.instruction, max_count)
      end

      if element.is_a?(Empty)
        []
      else
        element.items(loader, enforce_values: enforce_values, with_elements: with_elements)
      end
    end
def list(name,
             loader = nil,
             enforce_element: @enforce_all_elements,
             enforce_values: true,
             exact_count: nil,
             max_count: nil,
             min_count: nil,
             required: nil,
             with_elements: false)

      enforce_element = required unless required.nil?
      enforce_element ||= exact_count && exact_count > 0 || min_count && min_count > 0
      loader = Proc.new if block_given?

      @touched = true

      unless @elements_associative.key?(name)
        if enforce_element
          raise Errors::Validation.missing_list(@context, name, @instruction)
        end

        return []
      end

      elements = @elements_associative[name]

      elements.each do |element|
        case element
        when List, Empty
          next
        when Field
          raise Errors::Validation.expected_list_got_field(@context, element.instruction)
        when Fieldset
          raise Errors::Validation.expected_list_got_fieldset(@context, element.instruction)
        when Section
          raise Errors::Validation.expected_list_got_section(@context, element.instruction)
        end
      end

      if elements.length > 1
        raise Errors::Validation.expected_list_got_lists(
          @context,
          name,
          elements.map(&:instruction)
        )
      end

      element = elements[0]
      element.touch

      count = element.is_a?(Empty) ? 0 : element.length

      if exact_count && count != exact_count
        raise Errors::Validation.exact_count_not_met(@context, element.instruction, exact_count)
      end

      if min_count && count < min_count
        raise Errors::Validation.min_count_not_met(@context, element.instruction, min_count)
      end

      if max_count && count > max_count
        raise Errors::Validation.max_count_not_met(@context, element.instruction, max_count)
      end

      if element.is_a?(Empty)
        []
      else
        element.items(loader, enforce_values: enforce_values, with_elements: with_elements)
      end
    end
TODO: Consider adding the numerical validation options for Eno::List#items
       and possibly Eno::Section#fieldsets/elements/fields/lists as well.