Created
May 10, 2015 16:27
-
-
Save wende/4222d39e83d6394fae53 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
plik.txt: | |
en hello bye | |
pl witam dowidzenia | |
de guttenmorgen tschus | |
I13n.ex: | |
defmacro lang(a) do | |
File,stream "plik.txt" | |
|> String.split "\n" | |
|> Enum.map &String.split/1 | |
|> Enum.filter fn [lan,_,_] lan == a end | |
|> Enum.map fn [_,b,c] -> quote do | |
@hi unquote(b) @bye unquote(c) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment