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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="DaAnalyst" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  DaAnalyst
                    <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>Not as of yet, but it can be easily added. The only problem is to figure out what syntax to use. Personally, I dislike introducing new macros (like the <code>d/1</code> or the <code>s/1</code>). I need to do some brainstorming on this.</p>
<p>Thanks for the suggestion.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="289902" 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/extructure-a-flexible-destructure-library-for-elixir/53696/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-289902" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="289902"
                     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="387841" data-post-id="387841">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="DaAnalyst" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  DaAnalyst
                    <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>Finally managed to find some (Claude’s) time to complete the long planned and postponed feature set for the <code>:extructure</code> library. I’m aware this probably matters far less now than it did while we still used to actually code but I still prefer using <code>:extructure</code> even though it’s Claude writing most of the code now, because in my view it’s more compact and readable (e.g. for reviews) than the vanilla Elixir’s <code>Map.get</code>/<code>fetch</code>, <code>Keyword.get</code>/<code>fetch</code>, etc.</p>
<p>So, in addition to the existing loose (&amp; rigid) destructuring based on the <code>&lt;~/2</code> operator, there is now a match based destructuring for the likes of function headers and <code>case</code> statements:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">-%{ a} = %{ a: 1, b: 2}   # for atom keys
-@%{ a} = %{ "a" =&gt; 1}    # for string keys
</code></pre>
<p>The analog syntax with keyword lists and tuple keypairs is also supported.</p>
<p>Also added something I’ve long liked about JS (and been missing in Elixir) - the structuring shorthand:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">a = 1
b = 2
+%{ a, b}   # %{ a: 1, b: 2}
+@%{ a, b}  # %{ "a" =&gt; 1, "b" =&gt; 2}
</code></pre>
<p>Same for keywords or listed string keypairs and tuple atom and string keypairs.</p>
<p>Here’s the whole thing again with the examples and all: <a href="https://hex.pm/packages/extructure" class="inline-onebox" rel="nofollow">extructure | Hex</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="387841" 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/extructure-a-flexible-destructure-library-for-elixir/53696/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-387841" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="387841"
                     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>