<commit_before>(in-package :sicl-cons-high)

(defparameter *language* 'en-us)

(defun name-package (name)
  (let ((real-name (if (symbolp name) name (cadr name))))
    (package-name (symbol-package real-name))))

(defgeneric report-condition (condition stream language))

(defmethod print-object ((c name-mixin) stream)
  (report-condition c stream *language*))

(defmethod report-condition  ((c both-test-and-test-not-given)
			      stream
			      (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           Both keyword arguments :test and :test-not were given."
	  (name c)
	  (name-package (name c))))

(defmethod report-condition ((c must-be-nonnegative-integer)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A nonnegative integer was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-cons)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A cons cell was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A list (a cons or nil) was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-proper-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A proper list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-proper-or-circular-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A proper or circular list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-proper-or-dotted-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A proper or dotted list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-property-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A property list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-association-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A association list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c at-least-one-list-required)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           At least one list argument is required,~@
           but none was given."
	  (name c)
	  (name-package (name c))))
	  
(defmethod report-condition ((c at-least-one-argument-required)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           At least one argument is required,~@
           but none was given."
	  (name c)
	  (name-package (name c))))
	  
(defmethod report-condition ((c lists-must-have-the-same-length)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           The two lists passed as arguments must~@
           have the same length, but the following~@
           was given:~@
           ~s~@
           and~@
           ~s."
	  (name c)
	  (name-package (name c))
	  (list1 c)
	  (list2 c)))

(defmethod report-condition ((c setf-c*r-must-be-cons)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In the SETF expander for ~a (in the ~a package),~@
           the ~aargument ~s~@
           must be a cons cell, but the following was given instead:~@
           ~s."
	  (name c)
	  (name-package (name c))
	  (if (zerop (length (access-string c)))
	      ""
	      (format nil "C~aR of the " (access-string c)))
	  (original-tree c)
	  (type-error-datum c)))<commit_msg>Defined a warning condition to be signaled when both a :test and a :test-not are found at compile time.<commit_after>(in-package :sicl-cons-high)

(defparameter *language* 'en-us)

(defun name-package (name)
  (let ((real-name (if (symbolp name) name (cadr name))))
    (package-name (symbol-package real-name))))

(defgeneric report-condition (condition stream language))

(defmethod print-object ((c name-mixin) stream)
  (report-condition c stream *language*))

(defmethod report-condition  ((c both-test-and-test-not-given)
			      stream
			      (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           Both keyword arguments :test and :test-not were given."
	  (name c)
	  (name-package (name c))))

(defmethod report-condition ((c must-be-nonnegative-integer)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A nonnegative integer was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-cons)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A cons cell was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A list (a cons or nil) was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-proper-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A proper list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-proper-or-circular-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A proper or circular list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-proper-or-dotted-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A proper or dotted list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-property-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A property list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c must-be-association-list)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           A association list was required,~@
           but the following was given:~@
           ~s"
	  (name c)
	  (name-package (name c))
	  (type-error-datum c)))

(defmethod report-condition ((c at-least-one-list-required)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           At least one list argument is required,~@
           but none was given."
	  (name c)
	  (name-package (name c))))
	  
(defmethod report-condition ((c at-least-one-argument-required)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           At least one argument is required,~@
           but none was given."
	  (name c)
	  (name-package (name c))))
	  
(defmethod report-condition ((c lists-must-have-the-same-length)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package):~@
           The two lists passed as arguments must~@
           have the same length, but the following~@
           was given:~@
           ~s~@
           and~@
           ~s."
	  (name c)
	  (name-package (name c))
	  (list1 c)
	  (list2 c)))

(defmethod report-condition ((c setf-c*r-must-be-cons)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In the SETF expander for ~a (in the ~a package),~@
           the ~aargument ~s~@
           must be a cons cell, but the following was given instead:~@
           ~s."
	  (name c)
	  (name-package (name c))
	  (if (zerop (length (access-string c)))
	      ""
	      (format nil "C~aR of the " (access-string c)))
	  (original-tree c)
	  (type-error-datum c)))
(defmethod report-condition ((c warn-both-test-and-test-not-given)
			     stream
			     (language (eql 'en-us)))
  (format stream
	  "In ~a (in the ~a package),~@
           both keyword arguments :test and :test-not were given."
	  (name c)
	  (name-package (name c))))
{'fraction_non_alphanumeric': 0.14118972048735537, 'fraction_numerical': 0.0004095423364390294, 'mean_word_length': 2.1765853658536587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5000122', 'n_tokens_mistral': 3504, 'n_tokens_neox': 3186, 'n_words': 1054}