Skip to content

Instantly share code, notes, and snippets.

@roder
Created December 8, 2010 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roder/733521 to your computer and use it in GitHub Desktop.
Save roder/733521 to your computer and use it in GitHub Desktop.
Example = fun(Arg) ->
case Arg of
ohai ->
io:format("OHAI!~n");
foo ->
io:format("Foo!~n");
bar ->
io:format("Bar!~n");
_EverythingElse ->
io:format("~p~n",[_EverythingElse])
end
end.
Example(foo). %% outputs Foo!
Example(bar). %% outputs Bar!
Example(ohai). %% outputs OHAI!
Example("test"). %% outputs "test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment