<commit_before>;;;;; tré – Copyright (c) 2008–2013 <NAME> <<EMAIL>>

(defvar *type-predicates*
  '((nil        . not)
    (cons       . cons?)
	(list       . list?)
	(atom       . atom)
	(symbol     . symbol?)
	(function   . function?)
	(number     . number?)
	(integer    . number?)
	(float      . number?)
	(character  . character?)
	(array      . array?)
 	(string     . string?)
    (hash-table . hash-table?)))

(defun %declare-type-predicate (typ)
  (assoc-value typ *type-predicates*))

(defun %declare-statement-type-predicate (typ x)
  `(,(| (%declare-type-predicate typ)
        ($ typ '?))
     ,x))

(defun %declare-statement-type-1 (typ x)
  (unless (symbol? x)
	(error "Symbol expected but got ~A to declare as of type ~A." x typ))
  `(unless (| ,@(filter [%declare-statement-type-predicate _ x]
                        (force-list typ)))
	 (error "~A is not of type ~A. Object: ~A." ,(symbol-name x) (quote ,typ) ,x)))

(defun %declare-statement-type (x)
  (unless (<= 2 (length x))
	(error "Expected type and one or more variables, but got only ~A." x))
  `(progn
	 ,@(filter [%declare-statement-type-1 x. _] .x)))

(defvar *declare-statement-classes*
  '((type .	%declare-statement-type)))

(defun %declare-statement (x)
  (funcall
      (symbol-function
	      (| (assoc-value x. *declare-statement-classes*)
	         (error "Unknown declaration class ~A. Choose one of ~A instead."
		            x. (carlist *declare-statement-classes*))))
      .x))

(defmacro declare (&rest x)
  (unless x
	(error "Arguments expected."))
  (let body (filter #'%declare-statement (force-tree x))
	(when *assert*
  	  `(progn
	 	 ,@body))))
<commit_msg>Cleaned up.<commit_after>;;;;; tré – Copyright (c) 2008–2013 <NAME> <<EMAIL>>

(defvar *type-predicates*
  '((nil        . not)
    (cons       . cons?)
	(list       . list?)
	(atom       . atom)
	(symbol     . symbol?)
	(function   . function?)
	(number     . number?)
	(integer    . number?)
	(float      . number?)
	(character  . character?)
	(array      . array?)
 	(string     . string?)
    (hash-table . hash-table?)))

(defun %declare-type-predicate (typ)
  (assoc-value typ *type-predicates*))

(defun %declare-statement-type-predicate (typ x)
  `(,(| (%declare-type-predicate typ)
        ($ typ '?))
    ,x))

(defun %declare-statement-type-1 (typ x)
  (| (symbol? x)
	 (error "Symbol expected but got ~A to declare as of type ~A." x typ))
  `(unless (| ,@(filter [%declare-statement-type-predicate _ x]
                        (force-list typ)))
	 (error "~A is not of type ~A. Object: ~A." ,(symbol-name x) (quote ,typ) ,x)))

(defun %declare-statement-type (x)
  (| (<= 2 (length x))
	 (error "Expected type and one or more variables, but got only ~A." x))
  `(progn
	 ,@(filter [%declare-statement-type-1 x. _] .x)))

(defvar *declare-statement-classes*
  '((type .	%declare-statement-type)))

(defun %declare-statement (x)
  (funcall
      (symbol-function
	      (| (assoc-value x. *declare-statement-classes*)
	         (error "Unknown declaration class ~A. Choose one of ~A instead."
		            x. (carlist *declare-statement-classes*))))
      .x))

(defmacro declare (&rest x)
  (| x (error "Arguments expected."))
  (alet (filter #'%declare-statement (force-tree x))
	(when *assert*
  	  `(progn
	 	 ,@!))))

{'fraction_non_alphanumeric': 0.18145896656534954, 'fraction_numerical': 0.006686930091185411, 'mean_word_length': 2.6812080536912752, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '4016738', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1147, 'n_words': 318}