<commit_before>(in-package :de.anvi.croatoan)

;; (add scr #\a :y 10 :x 10)
;; (add scr "b" :y 11 :x 10)
;; (add scr #\a   :y 10 :x 10 :attributes '(:underline) :color-pair '(:yellow :red))
;; (add scr "bat" :y 11 :x 10 :attributes '(:underline :bold) :color-pair '(:black :green))
(defun add (window object &key attributes color-pair y x n)
  "Add the object (char or string) to the window, then advance the cursor.

If the destination coordinates y (row) and x (column) are given, move
the cursor to the destination first and then add the object (char or
string).

If n is given for a char, write n chars.

If n is given for a string, write at most n chars from the string. If
n is -1, as many chars will be added that will fit on the line."
  (typecase object
    (string
     (add-string window object :attributes attributes :color-pair color-pair :y y :x x :n n))
    ((or integer keyword character complex-char)
     (add-char   window object :attributes attributes :color-pair color-pair :y y :x x))))

;; Example: (add-char scr #\a :attributes '(:bold) :color-pair '(:red :yellow))
(defun add-char (window char &key attributes color-pair y x)
  "Add the char to the window, then advance the cursor.

If the destination coordinates y and x are given, move the cursor to the
destination first and then add the character."<commit_msg>Add complex-string type dispatch to add<commit_after>(in-package :de.anvi.croatoan)

;; (add scr #\a :y 10 :x 10)
;; (add scr "b" :y 11 :x 10)
;; (add scr #\a   :y 10 :x 10 :attributes '(:underline) :color-pair '(:yellow :red))
;; (add scr "bat" :y 11 :x 10 :attributes '(:underline :bold) :color-pair '(:black :green))
(defun add (window object &key attributes color-pair y x n)
  "Add the object (char or string) to the window, then advance the cursor.

If the destination coordinates y (row) and x (column) are given, move
the cursor to the destination first and then add the object (char or
string).

If n is given for a char, write n chars.

If n is given for a string, write at most n chars from the string. If
n is -1, as many chars will be added that will fit on the line."
  (typecase object
    ((or string complex-string)
     (add-string window object :attributes attributes :color-pair color-pair :y y :x x :n n))
    ((or integer keyword character complex-char)
     (add-char   window object :attributes attributes :color-pair color-pair :y y :x x))))

;; Example: (add-char scr #\a :attributes '(:bold) :color-pair '(:red :yellow))
(defun add-char (window char &key attributes color-pair y x)
  "Add the char to the window, then advance the cursor.

If the destination coordinates y and x are given, move the cursor to the
destination first and then add the character."
{'fraction_non_alphanumeric': 0.11380323054331865, 'fraction_numerical': 0.012481644640234948, 'mean_word_length': 3.814487632508834, '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': '1410058', 'n_tokens_mistral': 869, 'n_tokens_neox': 826, 'n_words': 430}