<commit_before>(require :stdiff)

(defpackage :stdiff-use-sample
  (:use :cl :chiku.util :stdiff))

(in-package :stdiff-use-sample)

(defun wrap-by-bracket (expr)
  (list '[ expr ']))

(defun wrap-by-brace (expr)
  (list '{ expr '}))

(defun bracebracket (base modified &optional (allowed-distance 0))
  (with-gensyms (refmark lostmark)
    (apply-modifiednode-converters
      (diff base modified refmark lostmark allowed-distance)
      base refmark lostmark #'wrap-by-brace #'wrap-by-bracket)))

;(bracebracket *first-impl* *second-impl*)

(require :pphtml)

(use-package :pphtml)

(defun show-stdiff-cl (base modified outhtml-pathspec &optional (allowed-distance 0))
  (output-as-html (format nil "<pre>~a</pre>"
                          (pair-coloring
                            "({" "})"
                            #'pphtml::green
                            (pair-coloring "([" "])"
                                           #'pphtml::red
                                           (bracebracket base modified allowed-distance))))
                  outhtml-pathspec))

(load "impls.lisp")

(show-stdiff-cl *first-impl* *third-impl* "tmp.html")
<commit_msg>[Tiny] Another use case is added.<commit_after>(require :stdiff)

(defpackage :stdiff-use-sample
  (:use :cl :chiku.util :stdiff))

(in-package :stdiff-use-sample)

(defun wrap-by-bracket (expr)
  (list '[ expr ']))

(defun wrap-by-brace (expr)
  (list '{ expr '}))

(defun bracebracket (base modified &optional (allowed-distance 0))
  (with-gensyms (refmark lostmark)
    (apply-modifiednode-converters
      (diff base modified refmark lostmark allowed-distance)
      base refmark lostmark #'wrap-by-brace #'wrap-by-bracket)))

;(bracebracket *first-impl* *second-impl*)

(require :pphtml)

(use-package :pphtml)

(defun show-stdiff-cl (base modified outhtml-pathspec &optional (allowed-distance 0))
  (output-as-html (format nil "<pre>~a</pre>"
                          (pair-coloring
                            "({" "})"
                            #'pphtml::green
                            (pair-coloring "([" "])"
                                           #'pphtml::red
                                           (bracebracket base modified allowed-distance))))
                  outhtml-pathspec))

(load "impls.lisp")

(show-stdiff-cl *first-impl* *third-impl* "tmp.html")

(show-stdiff-cl '(defmacro list/det% (&body clauses)
                   (if clauses
                     (let ((head (car clauses)))
                       `(if ,(car head)
                          (cons ,(cadr head) (list/det% ,@(cdr clauses)))
                          (list/det% ,@(cdr clauses))))))
                '(defmacro list/det% (&body clauses)
                   (if clauses
                     (let ((head (car clauses)))
                       (if (eq (car head) t)
                         `(cons ,(cadr head) (list/det% ,@(cdr clauses)))
                         `(if ,(car head)
                            (cons ,(cadr head) (list/det% ,@(cdr clauses)))
                            (list/det% ,@(cdr clauses)))))))
                "list-with-determiner.html" 1)

{'fraction_non_alphanumeric': 0.14659018483110262, 'fraction_numerical': 0.0015933715742511153, 'mean_word_length': 1.7486865148861646, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '615423', 'n_tokens_mistral': 976, 'n_tokens_neox': 926, 'n_words': 215}