Last active
December 22, 2015 00:28
-
-
Save leikind/6389093 to your computer and use it in GitHub Desktop.
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
your_map(Function, List) -> | |
ParentProcessPid = self(), | |
Pids = lists:map( | |
fun(Element) -> | |
spawn( | |
fun()-> | |
ParentProcessPid ! {self(), Function(Element) } | |
end | |
) | |
end, | |
List | |
), | |
lists:map( | |
fun(Pid) -> | |
receive | |
{Pid, Result} -> Result | |
end | |
end, | |
Pids | |
). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok,ok. This is my "pun" for the day.
If ruby has the "happy" gene, erlang must have the
fun
gene!Get it? The anonymous functions are
fun
! :nudge:Ok, I'll get back to work now.