Created
August 14, 2014 05:44
-
-
Save yehohanan7/2cd7bf5ee5cbe3762cfd 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
defmodule ProxyModule do | |
def proxy(f) do | |
fn [args] -> IO.inspect(args); f.(args) end | |
end | |
end | |
defmodule Calculator do | |
def sum(x, y) do | |
x + y | |
end | |
end | |
p = ProxyModule.proxy(&Calculator.sum/2) | |
p.(1,2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment