I am new to meta programming . I have a module like this
defmodule transport do
use Qber.Web, :status
some[some_option]
end
In my web.ex
. I have define this status
like this:
def status do
quote do
use Qber.Status
end
end
This is my status module
defmodule Qber.Status do
@moduledoc """
"""
defmacro __using__(_options) do
quote do
code
end
end
defmacro some(options) do
quote do
options = unquote options
IO.inspect options
end
end
end
When i use Qber.Web,:status.its working fine but I also want to send the value from some
to the macro in the status module right now its giving error some
undefined in transport. How can i do this?
some(some_options)
or are you trying to magically inject thesome
variable at some point? It is best if you state which problem you are trying to solve, since meta-programming is rarely the answer. – José Valim