<commit_before>Object subclass: Animal [
    | name |
    Animal class >> new: n [^super new init: n]
    init: n [name := n]
    speak [^name, ' says ', self sound]
]

Animal subclass: Horse [
    sound [^'neigh']
]

Animal subclass: Sheep [
    sound [^'baaaa']
]

Animal subclass: Cow [
    sound [^'moooo']
]

h := Horse new: 'CJ'.
h speak displayNl.
c := Cow new: 'Bessie'.
c speak displayNl.
(Sheep new: 'Little Lamb') speak displayNl.<commit_msg>Changes suggested by some nice person on codereview.stackexhange.com<commit_after>Object subclass: Animal [
    | name |
    Animal class >> named: aString [^self new name: aString]
    name: aString [name := aString]
    speak [^name, ' says ', self sound]
]

Animal subclass: Horse [
    sound [^'neigh']
]

Animal subclass: Sheep [
    sound [^'baaaa']
]

Animal subclass: Cow [
    sound [^'moooo']
]

h := Horse named: 'CJ'.
h speak displayNl.
c := Cow named: 'Bessie'.
c speak displayNl.
(Sheep named: 'Little Lamb') speak displayNl.
{'fraction_non_alphanumeric': 0.14516129032258066, 'fraction_numerical': 0.0, 'mean_word_length': 3.393805309734513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4079367', 'n_tokens_mistral': 370, 'n_tokens_neox': 342, 'n_words': 118}