Skip to content

Instantly share code, notes, and snippets.

@yehohanan7
Created August 14, 2014 05:44
Show Gist options
  • Save yehohanan7/2cd7bf5ee5cbe3762cfd to your computer and use it in GitHub Desktop.
Save yehohanan7/2cd7bf5ee5cbe3762cfd to your computer and use it in GitHub Desktop.
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