<commit_before><commit_msg>adding and-let* macro<commit_after>(eval-when-compile (require 'cl)); declare, first, rest

;;;; and-let*, based on Scheme's SRFI 2
;; Contrived usage example:
;; (and-let* ((buffer-path (buffer-file-name))
;;            (file-name (file-name-directory)))
;;           (message "You are visiting a file called %s in this buffer."
;;                    file-name))
(defmacro and-let* (varlist &rest body)
  "Equivalent to let*, but terminates early and returns nil if
any variable is bound to nil. BODY is only evaluated if all
variables were non-nil."
  (declare (debug (form &rest form)))
  (if (eq varlist '()) `(progn ,@body)
    (let* ((first-binding (first varlist))
           (var-name (first first-binding)))
      `(let (,first-binding)
         (if ,var-name
             (and-let* ,(rest varlist) ,@body))))))

(provide 'my-macros)
{'fraction_non_alphanumeric': 0.15765247410817032, 'fraction_numerical': 0.0011507479861910242, 'mean_word_length': 3.084507042253521, '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': '7021776', 'n_tokens_mistral': 279, 'n_tokens_neox': 268, 'n_words': 91}