This file contains 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 TestDefp do | |
defmacro __using__(_) do | |
quote do | |
import Kernel, except: [defp: 2] | |
end | |
end | |
# Let's redefine `defp/2` so that if MIX_ENV is `test`, the function will be | |
# defined with `def/2` instead of `defp/2`. | |
defmacro defp(fun, body) do |