Let's go through some more in-depth examples of using macros to accomplish some pretty cool things, things that are generally fairly difficult to accomplish in other languages.
We'll start with a debugging/tracer module that will enable us to automatically trace the methods of our library.
Of course, this is highly unnecessary since the Erlang VM itself is capable of adding this functionality for us without requiring anything from the developer.
As part of this example, we're going to dive into
use as it turns out, is a relatively simple function that invokes the
__using__ macro of the module passed. This, in turn, injects the code of the
For example, let's say we've defined ...