<commit_before>(require "types")

(defpackage :printer
  (:use :common-lisp :types)
  (:export :pr-str))

(in-package :printer)

(defun pr-mal-sequence (start-delimiter sequence end-delimiter)
  (concatenate 'string
               start-delimiter
               (format nil
                       "~{~A~^ ~}"
                       (mapcar #'pr-str (types::mal-value sequence)))
               end-delimiter))

(defun pr-str (ast)
  (when ast
    (case (types::mal-type ast)
      ('number (format nil "~d" (types::mal-value ast)))
      ('boolean (if (types::mal-value ast) "true" "false"))
      ('nil "nil")
      ('string (format nil "~s" (types::mal-value ast)))
      ('symbol (format nil "~a" (types::mal-value ast)))
      ('list (pr-mal-sequence "(" ast ")"))
      ('vector (pr-mal-sequence "[" ast "]")))))<commit_msg>Use fully qualified symbol names printer switch<commit_after>(require "types")

(defpackage :printer
  (:use :common-lisp :types)
  (:export :pr-str))

(in-package :printer)

(defun pr-mal-sequence (start-delimiter sequence end-delimiter)
  (concatenate 'string
               start-delimiter
               (format nil
                       "~{~A~^ ~}"
                       (mapcar #'pr-str (types::mal-value sequence)))
               end-delimiter))

(defun pr-str (ast)
  (when ast
    (case (types::mal-type ast)
      (types::number (format nil "~d" (types::mal-value ast)))
      (types::boolean (if (types::mal-value ast) "true" "false"))
      (types::nil "nil")
      (types::string (format nil "~s" (types::mal-value ast)))
      (types::symbol (format nil "~a" (types::mal-value ast)))
      (types::list (pr-mal-sequence "(" ast ")"))
      (types::vector (pr-mal-sequence "[" ast "]")))))
{'fraction_non_alphanumeric': 0.185121107266436, 'fraction_numerical': 0.0, 'mean_word_length': 2.5480572597137012, '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': '4763646', 'n_tokens_mistral': 571, 'n_tokens_neox': 556, 'n_words': 140}