Last active
June 14, 2016 16:51
-
-
Save pguillory/d7c090e226c8aed619af6a4d1963c69c to your computer and use it in GitHub Desktop.
Revisions
-
pguillory revised this gist
Jun 14, 2016 . 1 changed file with 3 additions and 1 deletion.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 @@ -9,4 +9,6 @@ case(:condition) do nil _ -> :ok end # cannot invoke remote function Enum.member?/2 inside guard -
pguillory revised this gist
Jun 14, 2016 . 1 changed file with 1 addition and 1 deletion.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 @@ -8,6 +8,6 @@ block |> IO.puts block |> Macro.prewalk(&Macro.expand(&1, __ENV__)) |> Macro.to_string |> IO.puts -
pguillory created this gist
Jun 14, 2016 .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,12 @@ case(:condition) do x when x in [false, nil] -> nil _ -> :ok end case(:condition) do x when Enum.member?([false, nil], x) -> nil _ -> :ok end 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,13 @@ block = quote do if :condition do :ok end end block |> Macro.expand_once(__ENV__) |> Macro.to_string |> IO.puts block |> Macro.prewalk(&Macro.expand_once(&1, __ENV__)) |> Macro.to_string |> IO.puts