Created
December 3, 2013 16:51
-
-
Save jwarwick/7772745 to your computer and use it in GitHub Desktop.
Elixir lookup working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule LookupWorking do | |
table = [ | |
{:a, "a"}, | |
{:b, "b"} | |
] | |
lc {key, val} inlist table do | |
def lookup(unquote(key)), do: unquote(val) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment