Skip to content

Instantly share code, notes, and snippets.

@mzemel
Last active October 22, 2015 15:05
Show Gist options
  • Save mzemel/a29d5863304f174a8e7a to your computer and use it in GitHub Desktop.
Save mzemel/a29d5863304f174a8e7a to your computer and use it in GitHub Desktop.
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