How can I pass functions to the macros in elixir?
<p>I'm working on a module which expands functionalities of other modules when <code>use</code>d. The problem is that sometimes I want to write some custom code in module definition which is used to boost module functionality:</p>

<p>So, it looks like:</p>

<pre><code>defmodule Included do
  defmacro __using__(_) do
    quote unquote: false do
      # a lot of code
      model
      |&gt; unquote(@callback)
      |&gt; another_bunch_of_things_in_pipe
    end
  end
end
</code></pre>

<p>And my module</p>

<pre><code>defmodule Poor do
  use Included

  @callback fn(model) -&gt; %{ model | poor: true } end
end
</code></pre>

<p>Not surprisingly, I have a <code>invalid quoted expression: #Function&lt;0.100338 in file:web/models/user.ex&gt;</code>. I found Jose Valim mention that it's impossible to unquote anonymous function.</p>

<p>So, can you introduce me good approach to pass and invoke custom code into macros in elixir?</p>