<commit_before>(in-package :lem)

(export '(*program-name*
          *debug-p*
          save-excursion
          with-point
          with-buffer-read-only
          with-current-window
          with-pop-up-typeout-window
          handler-case-bind))

(defvar *program-name* "Lem")
(defvar *debug-p* nil)

(defmacro define-class (name () default-arg-expr &body slots)
  (let ((garg (gensym "ARG"))
        (gval (gensym "VAL")))
    `(progn
       (defclass ,name ()
         ,(mapcar #'(lambda (slot)
                      `(,slot :initarg ,(intern (symbol-name slot) :keyword)
                              :initform nil))
                  slots))
       ,@(mapcan #'(lambda (slot)
                     (let ((name (intern (format nil "~a-~a" name slot))))
                       `((defun ,name (&optional (,garg ,default-arg-expr))
                           (slot-value ,garg ',slot))
                         (defun (setf ,name)
                             (,gval &optional (,garg ,default-arg-expr))
                           (setf (slot-value ,garg ',slot) ,gval)
                           ,gval))))
                 slots))))

(defmacro save-excursion (&body body)
  `(invoke-save-excursion (lambda () ,@body)))

(defmacro with-point (bindings &body body)
  (let ((cleanups
         (mapcan (lambda (b)
                   (destructuring-bind (var point &optional (kind :temporary)) b
                     (declare (ignore point))
                     (unless (eq :temporary kind)
                       `((delete-point ,var)))))
                 bindings)))
    `(let ,(mapcar (lambda (b)
                     (destructuring-bind (var point &optional (kind :temporary)) b
                       `(,var (copy-point ,point ,kind))))<commit_msg>define-classを除去<commit_after>(in-package :lem)

(export '(*program-name*
          *debug-p*
          save-excursion
          with-point
          with-buffer-read-only
          with-current-window
          with-pop-up-typeout-window
          handler-case-bind))

(defvar *program-name* "Lem")
(defvar *debug-p* nil)

(defmacro save-excursion (&body body)
  `(invoke-save-excursion (lambda () ,@body)))

(defmacro with-point (bindings &body body)
  (let ((cleanups
         (mapcan (lambda (b)
                   (destructuring-bind (var point &optional (kind :temporary)) b
                     (declare (ignore point))
                     (unless (eq :temporary kind)
                       `((delete-point ,var)))))
                 bindings)))
    `(let ,(mapcar (lambda (b)
                     (destructuring-bind (var point &optional (kind :temporary)) b
                       `(,var (copy-point ,point ,kind))))
{'fraction_non_alphanumeric': 0.14237793514722324, 'fraction_numerical': 0.0, 'mean_word_length': 1.5907335907335907, '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': '6563319', 'n_tokens_mistral': 810, 'n_tokens_neox': 775, 'n_words': 192}