example:

defmodule MyProgram do 
  defdag foo(par1, par2) do 
    <the body here>
  end
end

###############################################################################


defmacro defdag({name, _, args}, do: exp) do
    ast =
      quote do
        use Creek
        unquote(exp)
      end

    {result, _s} = Code.eval_quoted(ast, [], __ENV__)

    ast =
      quote do
        IO.puts("I'm also being evaluateds")
        unquote(Macro.escape(result))
      end

    quote do
      def unquote(name)(unquote_splicing(args)) do
        unquote(ast)
      end
    end
  end