<commit_before>package iii_conventions

import util.TODO


class Invokable(var numberInvocations: Int = 0) {

    operator fun invoke(): Invokable {
        numberInvocations++
        return this
    }

    fun getNumberOfInvocations() = numberInvocations
}

fun todoTask31(): Nothing = TODO(
    """
        Task 31.
        Change class Invokable to count the number of invocations (round brackets).
        Uncomment the commented code - it should return 4.
    """,
    references = { invokable: Invokable -> })

fun task31(invokable: Invokable): Int {
//    todoTask31()
    return invokable()()()().getNumberOfInvocations()
}<commit_msg>Make var private, smaller scope<commit_after>package iii_conventions

import util.TODO


class Invokable(private var nInvocations: Int = 0) {

    operator fun invoke(): Invokable {
        nInvocations++
        return this
    }

    fun getNumberOfInvocations() = nInvocations
}

fun todoTask31(): Nothing = TODO(
    """
        Task 31.
        Change class Invokable to count the number of invocations (round brackets).
        Uncomment the commented code - it should return 4.
    """,
    references = { invokable: Invokable -> })

fun task31(invokable: Invokable): Int {
//    todoTask31()
    return invokable()()()().getNumberOfInvocations()
}
{'fraction_non_alphanumeric': 0.10238645111624327, 'fraction_numerical': 0.015396458814472672, 'mean_word_length': 3.0625, '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': '5197438', 'n_tokens_mistral': 413, 'n_tokens_neox': 377, 'n_words': 113}