Created
December 6, 2010 13:26
-
-
Save bneijt/730285 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
lists:map(fun(X) -> erlang:display(X) end, ["hello"]). | |
lists:map(erlang:display, ["hello"]). | |
%Wrong, you can not refer to erlang:display that way. Would you be pointing to erlang:display/1 or erlang:display/2 ?? | |
lists:map(erlang:display/1, ["hello"]). | |
%Illegal expression, erlang:display/1 is more like splitting an atom in 1 then it is referring to a function | |
lists:map(fun erlang:display/1, ["hello"]). | |
%Yes, this will work. I'm now referring to the function display/1 in the erlang module... few. | |
[erlang:display(X) || X <- ["hello"]]. | |
%Also works, list expressions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment