Created
November 2, 2018 15:47
-
-
Save djthread/eba87074f048f544087741f735f1178f to your computer and use it in GitHub Desktop.
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 WackyMacro do | |
defmacro defalias(alias_name, alias_path) do | |
quote bind_quoted: [alias_name: alias_name, alias_path: alias_path] do | |
defmacro unquote(:"get_#{alias_name}")(path) do | |
quote bind_quoted: [path: path, alias_path: alias_path] do | |
get(var!(assigns).render_meta.parsed, alias_path ++ path) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment