# Eymenium Utils module

blueprint Utils:
    exp clamp(x, low, high):
        chk x < low:
            back low
        orchk x > high:
            back high
        back x

    exp coalesce(value, fallback):
        chk value == null:
            back fallback
        back value

    exp between(x, low, high):
        back x >= low also x <= high

    exp repeat(count, callback):
        i = 0
        while_condition = i < count
        spin while_condition:
            callback(i)
            i += 1
            while_condition = i < count
