Last active
June 21, 2019 16:25
-
-
Save koolquark/62bf7edc9b9c7ec280062b7030587dbc to your computer and use it in GitHub Desktop.
Elixir - Calling anonymous function at definition itself
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
(fn true -> IO.puts("yes its true") end).(true) | |
# Example | |
"hello" |> ( fn msg -> IO.puts(msg) end ).() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment