Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Created July 13, 2015 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcardarella/b82f33f6b270454e5bb7 to your computer and use it in GitHub Desktop.
Save bcardarella/b82f33f6b270454e5bb7 to your computer and use it in GitHub Desktop.
defmodule A do
def foo do
@bar
end
end
defmodule B do
use A
@bar :baz
end
@chrismccord
Copy link

defmodule A do
  use B
  def foo do
    @bar
  end
end

defmodule B do

  defmacro  __using__(_) do
    quote do
      @bar :baz
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment