Skip to content

Instantly share code, notes, and snippets.

@si14
Created July 28, 2011 14:52
Show Gist options
  • Save si14/1111677 to your computer and use it in GitHub Desktop.
Save si14/1111677 to your computer and use it in GitHub Desktop.
case foobar() of
{A, B} -> ...
{A} -> ...
end
barbaz(A) <- WUT?
let's try to extend our foobar():
case foobar() of
{A, B} -> ...
{A} -> ...
[] -> ...
end
OOPS BROKEN! And what if we do this properly:
A = case foobar() of
{A, B} -> ..., A;
{A} -> ..., A;
[] -> default_value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment