Skip to content

Instantly share code, notes, and snippets.

@ZachMassia
Created December 22, 2013 18:15
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 ZachMassia/8086389 to your computer and use it in GitHub Desktop.
Save ZachMassia/8086389 to your computer and use it in GitHub Desktop.
%% Erlang Version
universal_server() ->
receive
{become, F} ->
F()
end.
# Elixir Version
def universal_server do
receive do
{:become, F} ->
F() # syntax error before: '('
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment