Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule Foo do
- defmacro __using__(_) do
- quote do
- if Module.get_attribute(__MODULE__, :already_done) do
- IO.inspect "already done"
- else
- IO.inspect "doing"
- @already_done true
- end
- end
- end
- end
- defmodule Bar do
- use Foo
- use Foo
- use Foo
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement