<commit_before>;;;; nix operating system project
;;;; list processor environment
;;;; Copyright (C) 2005-2006,2008 <NAME> <<EMAIL>>
;;;;
;;;; Searching sequences

(defmacro xchg (a b)
  "Swaps values of the arguments."
  (with-gensym g
    `(setf ,g ,a
	   ,a ,b
	   ,b ,g)))

(defun find-if (pred seq &key (start nil) (end nil) (from-end nil) (with-index nil))
  (let* ((e (or end (1- (length seq))))
	 	 (s (or start 0)))
    ; Make sure the start and end indices are sane.
    (when (or (and (> s e) (not from-end))
              (and (< s e) from-end))
      (xchg s e))
    (do ((i s (if from-end
				  (1- i)
				  (1+ i))))<commit_msg>XCHG: Missed gensym. Fixed.<commit_after>;;;; TRE environment
;;;; Copyright (C) 2005-2006,2008-2009 <NAME> <<EMAIL>>
;;;;
;;;; Searching sequences

(defmacro xchg (a b)
  "Swaps values of the arguments."
  (with-gensym g
    `(let ,g ,a
	   (setf ,a ,b
	   		 ,b ,g))))

(defun find-if (pred seq &key (start nil) (end nil) (from-end nil) (with-index nil))
  (let* ((e (or end (1- (length seq))))
	 	 (s (or start 0)))
    ; Make sure the start and end indices are sane.
    (when (or (and (> s e) (not from-end))
              (and (< s e) from-end))
      (xchg s e))
    (do ((i s (if from-end
				  (1- i)
				  (1+ i))))
{'fraction_non_alphanumeric': 0.1910023677979479, 'fraction_numerical': 0.028413575374901343, 'mean_word_length': 2.571830985915493, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '511903', 'n_tokens_mistral': 541, 'n_tokens_neox': 476, 'n_words': 176}