Let's say I'd want to override each function call with a macro that counts how many times I called each particular function.
Is it possible in Elixir?
I know there is a possibility of overriding builtin macros and functions with
import Kernel, except: [name: arity]
import MyOwnKernel
But it doesn't seem to work for apply/2 nor apply/3
You cannot. Those are defined as special forms (Kernel.SpecialForms
) and they cannot be overridden.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With