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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think changing</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    gen String.to_atom("#{g}_z"), a,           do: {:ok, v, a} # undefined function v/0
</code></pre>
<p>to</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    gen String.to_atom("#{g}_z"), a,           do: {:ok, unquote(v), a} # should work fine this way
</code></pre>
<p>should work. As far as I can tell, you want to use a value of <code>v</code> that’s only available at compile time in the module, but as you have it, <code>v</code> and <code>a</code> are just regular variables declared in the body of a function.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58162" 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/macro-to-generate-function-with-body-containing-an-arg-and-var-bound-in-outer-scope/10075/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-58162" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58162"
                     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="58221" data-post-id="58221">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="jfeng" data-post="12" data-topic="10075">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jfeng/48/7098_2.png" class="avatar"> jfeng:</div>
<blockquote>
<p>unquote(v)</p>
</blockquote>
</aside>
<p>Do note, that only works if <code>v</code> is valid as an AST (which in this specific case a raw number is), otherwise you want <code>unquote(Macro.escape(v))</code> instead, which will always safely put it in the AST (well unless it is a PID or Ref or so).  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_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="58221" 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/macro-to-generate-function-with-body-containing-an-arg-and-var-bound-in-outer-scope/10075/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-58221" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58221"
                     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>