Best explained by an example. Lets say I want to call:
Calendar.ISO.naive_datetime_to_string(year, month, day, hour, minute, second, microsecond)
From another calendar module that implements @behaviour Calendar
. Calendar.ISO.naive_datetime_to_string
calls time_to_string(hour, minute, second, microsecond)
under the covers, resolved to be in the Calendar.ISO
module.
But … it also calls date_to_string(year, month, day)
which I’d like to be called as the version in my Calendar
module.
I don’t think this is possible (and quite possible its even “bad”) but I’ve found a few situations where I’d like to delegate a function call to another module, but have the inner functions be resolved to my module. Behaviour-based modules is quite a good example of where this can crop up I think,