Skip to content

Instantly share code, notes, and snippets.

@seancribbs
Created May 25, 2013 18:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seancribbs/5650150 to your computer and use it in GitHub Desktop.
Save seancribbs/5650150 to your computer and use it in GitHub Desktop.
-define(case_inf(E, E0, FC, E1, AC, E2, A, F, E3),
begin
AInf = (E),
if
not AInf ->
E0;
is_function(AInf) ->
FC = AInf,
E1;
is_tuple(AInf) andalso size(AInf) == 2 andalso is_function(element(2,AInf)) ->
A = element(1,AInf),
F = element(2,AInf),
E3;
true ->
AC = AInf,
E2
end
end).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment