If I understand your question, you could add
Clock() = Clock(1)
Pendulum() = Pendulum(1)
then
a = 100
divide(a, Clock(1)) == divide(a, Clock()) == 50.0
divide(a, Pendulum(1)) == divide(a, Pendulum()) == 5.0
However, what you are after is likely available more elegantly too.
Are you looking for something like this?
abstract type Wave end
struct Clock <: Wave
slow::Bool
end
struct Pendulum <: Wave
slow::Bool
end
function divide(a, wave::Clock)
return wave.slow ? a/2 : a/10
end
function divide(a, wave::Pendulum)
return wave.slow ? a/20 : a/100
end
const SlowClock = Clock(true)
const FastClock = Clock(false)
const SlowPendulum = Pendulum(true)
const FastPendulum = Pendulum(false)
then
julia> a = 100
100
julia> divide(a, SlowClock)
50.0
julia> divide(a, FastClock)
10.0
julia> divide(a, SlowPendulum)
5.0
julia> divide(a, FastPendulum)
1.0