Created
November 2, 2018 15:47
-
-
Save djthread/eba87074f048f544087741f735f1178f to your computer and use it in GitHub Desktop.
Revisions
-
djthread created this gist
Nov 2, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ 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