Last active
October 22, 2015 15:05
-
-
Save mzemel/a29d5863304f174a8e7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Tracer do | |
# ... | |
defmacro __using__(_opts) do | |
quote do | |
import Kernel, except: [def: 2] | |
import Tracer, only: [def: 2] | |
end | |
end | |
end | |
defmodule Calculator do | |
use Tracer | |
def puts_sum_three(a, b, c), do: IO.puts a + b + c | |
end | |
Calculator.puts_sum_three(1, 2, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment