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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>+1 - try to explain a whole problem - it looks like you are trying to solve your problem with a wrong way</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="126492" 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/alias-import-and-defdelegate-are-a-mess/22060/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-126492" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="126492"
                     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 #21"></div>
  </section>
</div>
    <div class="postbit" id="126496" data-post-id="126496">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="fgallaire" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fgallaire/120/14980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  fgallaire
                    <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">
								<aside class="quote no-group" data-username="fgallaire" data-post="17" data-topic="22060">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fgallaire/48/14980_2.png" class="avatar"> fgallaire:</div>
<blockquote>
<p>def func(e(something)), do: :things</p>
</blockquote>
</aside>
<p>I forgot the <code>unquote</code></p>
<p><a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> in fact there is 8 combinaisons:<br>
function or macro, unquoted or not, local or remote.<br>
For pedagogic purpose:</p>
<p>it’s never possible without <code>unquote</code>:<br>
remote function: <code>cannot invoke remote function Shortcuts.remote/1 inside a match</code><br>
local function: <code>cannot find or invoke local local/1 inside match.</code><br>
remote macro: <code>cannot invoke remote function Macro.escape/1 inside a match     expanding macro: Shortcuts.remote/1</code><br>
local macro: <code> cannot invoke remote function Macro.escape/1 inside a match     expanding macro: Test.local/1</code></p>
<p>With <code>unquote</code> it’s not possible locally:<br>
local function: <code>undefined function local/1</code><br>
local macro: <code>undefined function local/1</code></p>
<p>Remote function and macro work fine.<br>
BTW I need an other module for a simple shortcut, I don’t like that.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="126496" 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/alias-import-and-defdelegate-are-a-mess/22060/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-126496" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="126496"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="126497" data-post-id="126497">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The concrete realization of <code>e</code> in comments above depends on your needs, thats because we are asking you about your whole problem. I think, you don’t need <code>Macro.escape</code> at all. For example to match on map keys solution may looks like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Test do
  defmacrop e(kv) do
    quote do
      %{unquote_splicing(kv)}
    end
  end

  def me(e(a: 10)), do: :a_key_10
  def me(e(a: 20)), do: :a_key_20
  def me(e(b: _)),  do: :b_key
end
</code></pre>
<p>then in <code>iex</code>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(3)&gt; Test.me(%{a: 10})
:a_key_10
iex(4)&gt; Test.me(%{a: 20})
:a_key_20
iex(5)&gt; Test.me(%{b: :any})
:b_key
</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="126497" 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/alias-import-and-defdelegate-are-a-mess/22060/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-126497" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="126497"
                     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 #23"></div>
  </section>
</div>
    <div class="postbit" id="127243" data-post-id="127243">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="fgallaire" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fgallaire/120/14980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  fgallaire
                    <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>My problem is to match on map values <img src="https://forum.elixirforum.com/images/emoji/apple/innocent.png?v=15" title=":innocent:" class="emoji" alt=":innocent:" 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="127243" 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/alias-import-and-defdelegate-are-a-mess/22060/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-127243" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="127243"
                     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 #24"></div>
  </section>
</div>
    <div class="postbit" id="172499" data-post-id="172499">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="619" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  619
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I legit cannot figure out how to import one module into another. This is the future <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" loading="lazy" width="20" height="20"><img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" loading="lazy" width="20" height="20"><img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" 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="172499" 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/alias-import-and-defdelegate-are-a-mess/22060/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-172499" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="172499"
                     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 #25"></div>
  </section>
</div>
    <div class="postbit" id="172511" data-post-id="172511">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Importing is done via the <code>import</code> call. It will enable you to call functions from the imported module in your current scope without having to qualify them by the module.</p>
<p>So after <code>import Enum</code>, you can write <code>map(list, &amp;(&amp;1+1))</code> instead of having to write <code>Enum.map(list, &amp;(&amp;1+1))</code>.</p>
<p><code>import</code>ing is rarely really necessary, and unless building an EDSL should be avoided.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="172511" 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/alias-import-and-defdelegate-are-a-mess/22060/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-172511" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="172511"
                     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>