Skip to content

Instantly share code, notes, and snippets.

@dhruvchandna
Created February 13, 2012 23:19
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 dhruvchandna/1821384 to your computer and use it in GitHub Desktop.
Save dhruvchandna/1821384 to your computer and use it in GitHub Desktop.
Seven Languages In Seven Weeks: Erlang: Day2: Ex1
% Function that takes in a keyword and list of the form
% [{ruby,"an OO language"}, {erlang,"a functional language"}]
% and returns the associated value for the keyword.
Value = fun(X,L) -> [Y || {Z,Y} <- L, X=:=Z] end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment