<commit_before>(def orig (first *command-line-args*))

(def input (seq (char-array (first *command-line-args*))))

(defn palindrome? [s] (= s (reverse s)))

(def occurrences-map (frequencies input))

(def evens-map (filter (fn [[_, v]] (even? v)) occurrences-map))

(def odds-map (filter (fn [[_, v]] (odd? v)) occurrences-map))

(if (palindrome? input)
  (printf "%s is a palindrome%n" orig)
  (if (> (count (keys odds-map)) 1)
    (printf "%s cannot be made into a palindrome%n" orig)
    (println "dingo"))
)<commit_msg>Sort of getting somewhere on Clojure part 3<commit_after>(def orig (first *command-line-args*))
(def input (seq (char-array (first *command-line-args*))))
(defn palindrome? [s] (= s (reverse s)))
(def occurrences-map (frequencies input))
(def evens-map (filter (fn [[_, v]] (even? v)) occurrences-map))
(def odds-map (filter (fn [[_, v]] (odd? v)) occurrences-map))

(defn string-from-map [k, v] (apply str (take (quot v 2) (repeat k))))

(defn get-single [k, _] k)

; build full string with (apply str 1 2 3)
; iterate through pairs with (doseq [[k, v] map-name] ())
; final print = (printf "A palindromic form of %s is %s%n" orig (build-string s-evens s-odds single))

(if (palindrome? input)
  (printf "%s is a palindrome%n" orig)
  (if (> (count (keys odds-map)) 1)
    (printf "%s cannot be made into a palindrome%n" orig)
    (printf "A palindromic form of %s is %s%n" orig orig)
  )
)
{'fraction_non_alphanumeric': 0.18104667609618105, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 4.319548872180451, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4389588', 'n_tokens_mistral': 549, 'n_tokens_neox': 520, 'n_words': 187}