Created
April 6, 2017 23:34
-
-
Save jorendorff/eda72953cc9f0787320b4bb36c6605aa 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
# I claim attributes are a run-time feature | |
defmodule Petunia do | |
Module.register_attribute(__MODULE__, :myattr, accumulate: false) | |
Module.put_attribute(__MODULE__, :myattr, 1) | |
IO.puts(@myattr) | |
Module.put_attribute(__MODULE__, :myattr, 2) | |
IO.puts(@myattr) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment