Can an application work with macros in Elixir?

Let's say I would like to redefine every function call with a macro that counts how many times I called each specific function.
 Is this possible in Elixir?

I know that it is possible to override built-in macros and functions with

import Kernel, except: [name: arity]
import MyOwnKernel

But it does not work for apply / 2 and does not apply / 3

+4
source share
2 answers

You can not. They are defined as special forms ( Kernel.SpecialForms), and they cannot be redefined.

+4
source

, , Erlang. .

, fprof , . IIRC fprof , , .

+4

All Articles