<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="242953" data-post-id="242953">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In general the pattern for a macro that creates a module attribute in the calling code that is then accessed in the macro is something like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmacro my_macro(opts) do
  # Set up the module and fields from wherever they are derived
  module = Keyword.get(opts, :module)
  fields = Keyword.get(opts, :fields)

  # Register and set the module attribute in the calling module at
  # macro expansion time. At this time the calling module is
  # still being compiled
  calling_module = __CALLER__.module
  Module.register_attribute(calling_module, :counter_cache_fields)
  Module,put_attribute(calling_module, :counter_cache_fields, fields)

  # Now the code that is injected in the caller
  quote do
    defmacro counter_cache_query(module) do
      # CounterCache.__query__(unquote(module), @counter_cache_fields)
    end
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242953" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-242953" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242953"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="242954" data-post-id="242954">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thiagomajesk" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/120/31904_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thiagomajesk
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey <a class="mention" href="/u/kip" rel="nofollow">@kip</a>, one question: If I understand it right, <code>__MODULE__</code> inside a quoted expression in a macro will expand to the invoking module like <code>__CALLER__</code> outside of the quoted expression. So, I’m not sure I understood the difference, but I guess there’s a compilation order, would you mind explaining it a little bit more?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242954" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-242954" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242954"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="242955" data-post-id="242955">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><code>__MODULE__</code> always refers to the module being compiled.  So when <code>__MODULE__</code> is inside a quote block (assuming the macro returns the <code>quote</code> block), then <code>__MODULE__</code> is expanded in the calling module.  So yes, you are correct.  In this case, <code>__CALLER__.module</code> in a macro outside a quote block is the same as <code>__MODULE__</code> inside a quote block.</p>
<p>In your example, we need to access the caller outside the quote block.  Because we need to guarantee that the module attribute is registered and set <em>before</em> the macro code is expanded in the caller. Therefore it needs to be executed in the context of the macro, not the context of the caller.  And therefore we need to use <code>__CALLER__.module</code> approach.</p>
<p>Does that help?  I find it useful to remember a few simple things about macros:</p>
<ul>
<li>A macro is a function that accepts AST as parameters and is expected to return AST</li>
<li>A quote block returns AST and is the most common way to return AST from a macro. But its otherwise not special - you can <code>quote</code> in any code you like at compile time or runtime.</li>
<li>A macro is expanded at the time at which it is called. Macro expansion happens recursively until there is nothing left to expand.</li>
<li>A call to a macro replaces the macro call with the result of the macro call. It is interpolated at the calling site. And then compilation proceeds normally.</li>
<li>A macro is just normal Elixir code except for the requirement to accept AST and return AST so it can execute whatever you want - recognising that this code is executing during macro expansion at compile time, not at runtime.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242955" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-242955" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242955"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="242963" data-post-id="242963">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thiagomajesk" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/120/31904_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thiagomajesk
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks, <a class="mention" href="/u/kip" rel="nofollow">@kip</a>, I think this is really helpful, but I still have some questions, for example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Greeter do
  defmacro greeting(name) do
    quote do
      Module.put_attribute(__MODULE__, :greeting, unquote(name))
    end 
   end
   
   defmacro __using__(opts) do
    quote do
      import Greeter
      Module.register_attribute(__MODULE__, :greeting, accumulate: false)
      
      def greet_inside() do
        @greeting
      end      
    end
   end 
end
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Gentlemen do
  use Greeter
  
  greeting "Hello Sir"
  
  def greet, do: @greeting  
end
</code></pre>
<p>So, let’s see if I understand it right, the previous example will yield:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Gentlemen.greet
#==&gt; `"Hello Sir"`
Gentlemen.greet_inside
#==&gt; nil
</code></pre>
<p>Considering that a macro is expanded when it’s called, so <code>Greeter.__using__</code> is expanded first, adding the <code>@greeting</code> attribute to <code>Gentlemen</code> and defining the <code>greet_inside()</code> function, which outputs the <code>@greeting</code> attribute. So, <code>greet_inside()</code> outputs <code>nil</code> when its called because at compilation time the attribute was registered but no value was assigned to it yet. Then, the <code>greeting</code> macro is expanded and it adds <code>"Hello Sir"</code> to the <code>@greeting</code> attribute, and that’s why <code>greet()</code> outputs <code>"Hello Sir"</code>. Is my understanding right? (does the code expands top to bottom sequentially like this?).</p>
<p>Considering I’m right, for this to work, <code>greet_inside()</code> has to be a macro otherwise <code>@greeting</code> would be evaluated to <code>nil</code> at that point. So I was expecting this to work:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmacro greet_inside() do
  quote do
    @greeting
  end
end      
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir">import Gentlemen
Gentlemen.greet_inside()

** (ArgumentError) cannot invoke @/1 outside module
    (elixir 1.13.1) lib/kernel.ex:6111: Kernel.assert_module_scope/3
    (elixir 1.13.1) expanding macro: Kernel.@/1
    iex:12: (file)
    expanding macro: Gentlemen.greet_inside/0
    iex:12: (file)
</code></pre>
<p>But it won’t, because when <code>greet_inside()</code> is imported and called (and expanded), I’m outside of a module (I’m testing it on <code>iex</code>) and I can’t access attributes outside of modules. I imagine that <code>__CALLER__.module</code> in that context won’t return anything either, so what are my other options?</p>
<aside class="quote no-group" data-username="kip" data-post="14" data-topic="46021">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/48/1440_2.png" class="avatar"> kip:</div>
<blockquote>
<p>In your example, we need to access the caller outside the quote block. Because we need to guarantee that the module attribute is registered and set <em>before</em> the macro code is expanded in the caller. Therefore it needs to be executed in the context of the macro, not the context of the caller. And therefore we need to use <code>__CALLER__.module</code> approach.</p>
</blockquote>
</aside>
<p>I think I understood what you mean, but I’m having a hard time applying it for this scenario. I think it’s a little different because we are setting the attribute value after the macro that registered it? (unless macros are expanded all at once, so I wouldn’t have the reference to the attribute yet!?)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242963" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-242963" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242963"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="242964" data-post-id="242964">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I realise this may just be an example, but in this example I don’t see what they need to <code>use</code> a module when <code>import</code> will work just as well and is clearer in most cases.  Simplifying your example we get:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Greeter do
  defmacro greeting(name) do
    caller = __CALLER__.module

    # Define the attribute and set it in the calling module
    Module.register_attribute(caller, :greeting, accumulate: false)
    Module.put_attribute(caller, :greeting, name)

    # Code interpolated into the
    # calling site
    quote do
      def greet_inside() do
        @greeting
      end
    end
  end
end

defmodule Gentlemen do
  import Greeter

  greeting "Hello Sir"

  def greet, do: @greeting
end
</code></pre>
<p>And in execution:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(1)&gt; Gentlemen.greet_inside
"Hello Sir"
iex(2)&gt; Gentlemen.greet       
"Hello Sir"
</code></pre>
<p>Hopefully this helps clarify the order of expansion, compilation and execution.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242964" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-242964" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242964"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="242965" data-post-id="242965">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If you feel compelled to go the “use” route, then all you would need to do is:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Greeter do
  defmacro __using__(_opts) do
    import Greeter
  end

  defmacro greeting(name) do
    ....
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242965" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-242965" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242965"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="242966" data-post-id="242966">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Last thought, you might be wondering why this didn’t work:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">   defmacro __using__(opts) do
     quote do
       import Greeter
       # This code will be inserted in the calling site and it will
       # be executed at runtime, not compile time because it is
       # in the quote block that will be inserted at the calling site
       Module.register_attribute(__MODULE__, :greeting, accumulate: false)
      
       def greet_inside() do 
         # Using @module_attribute requires that the module
         # attribute exist *at compile time*. But the code above is
         # only executed at runtime. Therefore the reference to 
         # @greeting will fail
         @greeting
       end      
     end
   end 
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242966" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-242966" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242966"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="242969" data-post-id="242969">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thiagomajesk" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/120/31904_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thiagomajesk
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hummmm, very very interesting… Thanks a lot for the explanations <a class="mention" href="/u/kip" rel="nofollow">@kip</a>! I think your example without <code>use</code> in particular made it a lot easier for me to understand. Also, the explanation about what is evaluated at runtime vs compile-time was on point, thanks a lot. I’ll start from here and I’ll read more about macros with that in mind, thanks a lot for sparring the time to educate me on the subject.</p>
<p>Cheers!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="242969" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-242969" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="242969"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="243406" data-post-id="243406">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thiagomajesk" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/120/31904_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thiagomajesk
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If perhaps someone finds this post in the future, I’ll leave a link to a gist with my final solution:<br>
<a href="https://gist.github.com/thiagomajesk/0d5f5432cccf44128a1f13180cffcb5d" class="inline-onebox" rel="noopener nofollow ugc">Elixir's Ecto Counter Cache Manager · GitHub</a>. Many thanks to <a class="mention" href="/u/kip" rel="nofollow">@kip</a> in special and the awesome Elixir documentation on the subject of <a href="https://elixir-lang.org/getting-started/meta/macros.html" rel="nofollow">macros</a>.</p>
<p>Obs.: Working with macros is very fun, especially because Elixir makes metaprogramming very enjoyable compared to other languages. However, there’s a reason why the documentation warns us to proceed with caution haha <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20">.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="243406" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-243406" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="243406"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="243564" data-post-id="243564">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ityonemo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/120/11341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ityonemo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just be careful <code>__CALLER__.module</code> is not always the same as <code>__MODULE__</code>, for example if your quote block contains a <code>defmodule</code>, <code>defprotocol</code>, or <code>defimpl</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="243564" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-expose-or-use-a-module-attribute-that-is-built-using-macros/46021/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-243564" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="243564"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>