<commit_before>
(defmacro myformat (fmt-string &body fmt-args)
  `(let ((result (format nil ,fmt-string ,@fmt-args)))
     (fresh-line)
     (prin1 ,fmt-string) (fresh-line)
     (prin1 ,@fmt-args) (fresh-line)
     (prin1 result)))

(myformat "This is ~a ~%" 'something)
(format t "String ~s in a string~%" "Simon")
(format t "String ~a in a string~%" "Simon")

(format t "This is ~10@a with lots of space ~%" 10)
(format t "This is ~10a with lots of space ~%" 10)
(format t "This is ~10,3a with lots of space ~%" 10)
(format t "This word ~,,4,'!a is big~%" "james")
(format t "This word ~@,,4,'!a is big~%" "james")

(format t "~a in hex is ~x~%" 256 256)
(format t "~a in binary is ~b~%" 42 42)
(format t "floats ~f ~%" 22.7)
(format t "floats ~5f ~%" 22.7777732747)
(format t "floats ~9e ~%" 22.7777732747)

(format t "~r ~%" 12345)

(format t "~{~a, ~}~%" (list 1 2 3))
(format t "~{~a~^, ~}~%" (list 1 2 3))

(format t "~{~a~#[~;, and ~:;, ~]~}" (list 1 2 3))

(defparameter *english-list*
  "~{~#[~;~a~;~a and ~a~:;~@{~a~#[~;, and ~:;, ~]~}~]~}")

(defparameter *my-english-list* (concatenate 'string *english-list* "~%"))

(format t *my-english-list* '())
(format t *my-english-list* '(1))
(format t *my-english-list* '(1 2))
(format t *my-english-list* '(1 2 3))
(format t *my-english-list* '(1 2 3 4))

(defvar *compiler-format-string*
  "Done.~^ ~@(~R~) warning~:p.~^ ~@(~R~) error~:p.~%")

(format t *compiler-format-string* 0 0)
(format t *compiler-format-string* 1 0)
(format t *compiler-format-string* 1 33)
(format t *compiler-format-string* 33)<commit_msg>Working macro for defining tests<commit_after>
(defmacro myformat (fmt-string &body fmt-args)
  `(let ((result (format nil ,fmt-string ,@fmt-args)))
     (fresh-line)
     (format t "format(~s, ~{~a~^, ~})~%" ,fmt-string '(,@fmt-args))
     ;; (prin1 ',fmt-args) (fresh-line)

     (prin1 result)))

(myformat "This is ~a ~%" "something")
(myformat "String ~s in a string~%" "Simon")
(myformat "String ~a in a string~%" "Simon")

(myformat "This is ~10@a with lots of space ~%" 10)
(myformat "This is ~10a with lots of space ~%" 10)
(myformat "This is ~10,3a with lots of space ~%" 10)
(myformat "This word ~,,4,'!a is big~%" "james")
(myformat "This word ~@,,4,'!a is big~%" "james")

(myformat "~a in hex is ~x~%" 256 256)
(myformat "~a in binary is ~b~%" 42 42)
(myformat "floats ~f ~%" 22.7)
(myformat "floats ~5f ~%" 22.7777732747)
(myformat "floats ~9e ~%" 22.7777732747)

(myformat "~r ~%" 12345)

(myformat "~{~a, ~}~%" (list 1 2 3))
(myformat "~{~a~^, ~}~%" (list 1 2 3))

(myformat "~{~a~#[~;, and ~:;, ~]~}" (list 1 2 3))

(defparameter *english-list*
  "~{~#[~;~a~;~a and ~a~:;~@{~a~#[~;, and ~:;, ~]~}~]~}")

(defparameter *my-english-list* (concatenate 'string *english-list* "~%"))

(myformat *my-english-list* '())
(myformat *my-english-list* '(1))
(myformat *my-english-list* '(1 2))
(myformat *my-english-list* '(1 2 3))
(myformat *my-english-list* '(1 2 3 4))

(defvar *compiler-format-string*
  "Done.~^ ~@(~R~) warning~:p.~^ ~@(~R~) error~:p.")

(myformat *compiler-format-string* 0 0)
(myformat *compiler-format-string* 1 0)
(myformat *compiler-format-string* 1 33)
(myformat *compiler-format-string* 33)
{'fraction_non_alphanumeric': 0.24632697718036886, 'fraction_numerical': 0.05595498593310409, 'mean_word_length': 4.460750853242321, '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': '5652530', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1353, 'n_words': 399}