<commit_before>(defrecord Cat [color name])
(defrecord Dog [color name])

(def cat (Cat. "Calico" "Fuzzy McBootings"))
(def dog (Dog. "Brown" "Brown Dog"))
(:name cat)
(:name dog)
<commit_msg>add polymorphism to Records with Protocol<commit_after>(defrecord Cat [color name])
(defrecord Dog [color name])

(def cat (Cat. "Calico" "Fuzzy McBootings"))
(def dog (Dog. "Brown" "Brown Dog"))
(:name cat)
(:name dog)

;type polimorphism with Record/Protocol
(defprotocol NoiseMaker
  (make-noise [this]))

(defrecord NoisyCat [color name]
  NoiseMaker
  (make-noise [this] (str (:name this) "meows!")))

(defrecord NoisyDog [color name]
  NoiseMaker
  (make-noise [this] (str (:name this) "barks!")))

(def noisy-cat (NoisyCat. "Calico" "Fuzzy McBootings"))
(def noisy-dog (NoisyDog. "Brown" "Brown Dog"))
{'fraction_non_alphanumeric': 0.16625, 'fraction_numerical': 0.0, 'mean_word_length': 5.512195121951219, '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': '6863453', 'n_tokens_mistral': 310, 'n_tokens_neox': 285, 'n_words': 95}