I have two functions
f(x, y) and
g(x, y). For some types of
x, it may be advantageous to reuse components of calculations when both are needed, for some other types this is not the case. On the other hand, sometimes I just need
I could define
fg(x, y) = f(x,y), g(x, y) f(x, y) = fg(x,y) g(x, y) = fg(x,y)
as fallback methods, and then either define
fg(x::SomeType, y) = ...
f(x::SomeOtherType, y) = ... g(x::SomeOtherType, y) = ...
The problem is that if I have a missing method, I get a
StackOverflowError. Is there a way to avoid this, and break the circularity when I don’t have the right methods?