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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ll echo <a href="https://forum.elixirforum.com/u/LostKobrakai" rel="nofollow">@LostKobrakai</a>’s sentiment - the originally proposed is a solution to a problem I don’t have, and will only result in less-readable code and more lessons needed for getting developers without prior Elixir experience up to speed (which is already a problem).</p>
<p>Having two ways of doing something adds an additional layer of cognitive burden to a developer, as now there isn’t just the coming up with the solution, there is the added task of deciding which solution is best.</p>
<p>The acc/rebind mention ideas are interesting, but I’d much rather it work without the internal assignment, maybe something along the lines of:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0
{list, j} = for element &lt;- [1, 2, 3] do
    element * i
  acc
    i + 1
  result
    i
  end

list #=&gt; [0, 2, 6]
i #=&gt; 0
j #=&gt; 3
</code></pre>
<p>Or even just</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0
{list, j} = for element &lt;- [1, 2, 3] do
    element * i
  acc
    i + 1
end
</code></pre>
<p>¯\_(ツ)_/¯</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310300" 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/local-accumulators-for-cleaner-comprehensions/60130/157">Post #156</a>
	                </div>
	            </div>
              <div id="likers-container-310300" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310300"
                     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 #156"></div>
  </section>
</div>
    <div class="postbit" id="310321" data-post-id="310321">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Miserlou" data-post="157" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/miserlou/48/24973_2.png" class="avatar"> Miserlou:</div>
<blockquote>
<p>The acc/rebind mention ideas are interesting, but I’d much rather it work without the internal assignment, maybe something along the lines of:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0
{list, j} = for element &lt;- [1, 2, 3] do
    element * i
  acc
    i + 1
  result
    i
  end

list #=&gt; [0, 2, 6]
i #=&gt; 0
j #=&gt; 3
</code></pre>
<p>Or even just</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0
{list, j} = for element &lt;- [1, 2, 3] do
    element * i
  acc
    i + 1
end
</code></pre>
</blockquote>
</aside>
<p>I really don’t care for this. You’re rebinding <code>i</code> to the accumulator <code>j</code> but continuing to refer to <code>i</code>. Most confusing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310321" 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/local-accumulators-for-cleaner-comprehensions/60130/158">Post #157</a>
	                </div>
	            </div>
              <div id="likers-container-310321" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310321"
                     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 #157"></div>
  </section>
</div>
    <div class="postbit" id="310322" data-post-id="310322">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Fair enough! I generally agree and everything you said is something that was top of mind to me at the time of writing, my main thought in throwing the js example out there was to get the thinking going towards the expressiveness of the thing rather than the mechanics of the thing. In my opinion, if we focused on the fact that <code>let</code> in other languages doesn’t allow for rebinding we miss out on asking the question “does this sufficiently allow for the correct expressiveness”.</p>
<p>All the above said I generally agree that having multiple concepts of <code>let</code> would be confusing <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="310322" 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/local-accumulators-for-cleaner-comprehensions/60130/159">Post #158</a>
	                </div>
	            </div>
              <div id="likers-container-310322" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310322"
                     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 #158"></div>
  </section>
</div>
    <div class="postbit" id="310331" data-post-id="310331">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Personally I would lean towards not liking or using this.<br>
One of elixirs killer features is “its done” and you saying you would only add things if they proved significant merit for everyone. This has a ton of divided discussion, I don’t think its worth the change.</p>
<p>Edit: Mild thought might be - Maybe a new <code>def</code> block that exposes this kind of logic like how <code>defn</code> is the numerical subset. <code>defa</code> could be the accumulator subset.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310331" 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/local-accumulators-for-cleaner-comprehensions/60130/160">Post #159</a>
	                </div>
	            </div>
              <div id="likers-container-310331" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310331"
                     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 #159"></div>
  </section>
</div>
    <div class="postbit" id="310341" data-post-id="310341">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mtrudel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mtrudel/120/28190_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mtrudel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Bandit</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So far, I think the block syntax is the ‘elixir-iest’ out of the options presented here</p>
<ul>
<li>
<p><code>mut</code> is clear in intention (mostly because it’s how other languages do it), but nothing else in Elixir has that same shape so it sticks out a bit as a unique ‘keyword-ism’. It also seems ripe for misuse; I can <em>easily</em> see it being the sort of thing that new developers would cargo cult (‘i just stick a <code>mut</code> in front of <em>all</em> my variables’)</p>
</li>
<li>
<p>A <code>binding</code>  clause on comprehensions feels familiar (a lot like <code>bind_quoted</code>, both in form and intent), but I agree that comprehensions are already very option heavy, and it would also be a bit odd to have a clause on the comprehension affect the bindings of its <em>parent</em> block (that is pretty atypical; the only place I can think that does this already is <code>var!</code>).</p>
</li>
<li>
<p>On the other hand, an <code>accum</code> block ticks all the boxes. It’s lexically obvious, is cut from similar cloth as the rest of the language, doesn’t leak effects outside of itself, and provides a place to hang configuration in the same way eg. <code>quote</code> does. But most of all, it’s the clearest to dig in to for those who may be curious as to what makes it special. Personally, I  love knowing that the only <em>truly</em> magical things in the language all live in <code>Kernel.SpecialForms</code> and presumably this would be no different; having <code>quote</code>, <code>for</code>, <code>fn</code> et. al. as bedfellows would make <code>accum</code> feel a very natural part of the language IMO.</p>
</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="310341" data-batch-url="/posts/batch_likers">
                        17
                      </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/local-accumulators-for-cleaner-comprehensions/60130/161">Post #160</a>
	                </div>
	            </div>
              <div id="likers-container-310341" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310341"
                     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 #160"></div>
  </section>
</div>
    <div class="postbit" id="310358" data-post-id="310358">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You can kind of approximate a map_reduce with a Collectable without metaprogramming. You could have the Collectable take a function, and I think that would be less strange, but to have the “do” block still be what determines what’s returned, I experimented with having the comprehension collect 1-arity functions that update the acc and return a map_reduce-style tuple.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Acc do
  defstruct [:initial]

  def new(initial) do
    %__MODULE__{initial: initial}
  end

  defimpl Collectable do
    @impl Collectable
    def into(acc) do
      {{[], acc.initial}, &amp;collect/2}
    end

    defp collect(emitted_and_acc, command)

    defp collect({emitted, acc}, {:cont, fun}) do
      {newly_emitted, new_acc} = fun.(acc)
      {[newly_emitted | emitted], new_acc}
    end

    defp collect({emitted, acc}, :done) do
      {Enum.reverse(emitted), acc}
    end

    defp collect(_acc, :halt) do
      :ok
    end
  end
end
</code></pre>
<p>To be used like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">for x &lt;- 1..3, into: Acc.new(0) do
  fn acc -&gt;
    {x * 2, acc + x}
  end
end
#=&gt; {[2, 4, 6], 6}
</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="310358" 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/local-accumulators-for-cleaner-comprehensions/60130/162">Post #161</a>
	                </div>
	            </div>
              <div id="likers-container-310358" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310358"
                     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 #161"></div>
  </section>
</div>
    <div class="postbit" id="310367" data-post-id="310367">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m curious what the <code>accumulate do</code> alternative would actually look like. I didn’t notice any examples in this thread fleshing it out yet.</p>
<p>One of the things I really appreciate about Elixir is that everything has really consistent and tight lexical scoping, and variables never magically escape, even from an <code>if</code>.</p>
<p>I would hope to see that continue inside an <code>accumulate</code> block. Binding to variables outside the block would seem to break this pattern..</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310367" 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/local-accumulators-for-cleaner-comprehensions/60130/163">Post #162</a>
	                </div>
	            </div>
              <div id="likers-container-310367" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310367"
                     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 #162"></div>
  </section>
</div>
    <div class="postbit" id="310369" data-post-id="310369">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The proposal allows using variables in scope that are outside the block but only rebinding variables defined <em>on</em> the block:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">accum foo &lt;- initial, bar &lt;- initial_bar do ...
</code></pre>
<p>Above <code>foo</code> and <code>bar</code> can be rebound <em>within</em> the block and when the block completes whatever values <code>foo</code> or <code>bar</code> are bound to will be in the current scope.</p>
<p>I actually prefer <strong>reduce</strong> because that’s what it does, it reduces whatever is in scope via a block of code into those bindings declared on the block which may be rebound <strong>anywhere</strong> within the block, with the restriction that rebinding cannot escape the block, e.g. calling other functions including anonomous functions cannot rebind <code>foo</code> or <code>bar</code> but you can certainly pass <code>foo</code> or <code>bar</code> to other functions within the block as values.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">reduce foo &lt;- initial, bar &lt;- initial_bar do ...
</code></pre>
<p>This all comes with the caveat that it is my interpretation of what Jose has presented and I may not fully grasp what he has in mind.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310369" 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/local-accumulators-for-cleaner-comprehensions/60130/164">Post #163</a>
	                </div>
	            </div>
              <div id="likers-container-310369" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310369"
                     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 #163"></div>
  </section>
</div>
    <div class="postbit" id="310374" data-post-id="310374">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>+1 to having <code>mut</code> or some keyword and let the text editor underline/highlight that the variable is mutable. That looks the most elegant, as shown in the other thread:</p>
<aside class="quote no-group quote-modified" data-username="cmo" data-post="43" data-topic="60093" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmo/48/19618_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/koka-inspired-local-mutable-variables-for-cleaner-comprehensions/60093/43" rel="nofollow">Koka-inspired local mutable variables for cleaner comprehensions</a></div>
<blockquote>
<p>Editors can help with readability without adding extra syntax to the variable. Rider adds an underline for mutable variables in F#</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/f/0/f0ce09e3007f6772028eef65d4a4d2496de3b286.png" data-download-href="https://forum.elixirforum.com/uploads/default/f0ce09e3007f6772028eef65d4a4d2496de3b286" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/3X/f/0/f0ce09e3007f6772028eef65d4a4d2496de3b286.png" alt="image" data-base62-sha1="ymg1LZPeik9GfYX1EtIwBpYuKZo" width="454" height="399"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">454×399 14 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
</blockquote>
</aside>
<p>Having the keyword <code>reduce</code> makes more sense than <code>accum</code>, I agree, though it seems like <code>mut</code> is cleaner.</p>
<p>Having to wrap the solution in an extra block looks…</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">
reduce section_counter &lt;- 0, lesson_counter &lt;- 0 do
  for section &lt;- sections do
    if section["reset_lesson_position"] do
      lesson_counter = 0
    end
  
    section_counter = section_counter + 1
  
    lessons =
      for lesson &lt;- section["lessons"] do
        lesson_counter = lesson_counter + 1
        Map.put(lesson, "position", lesson_counter)
      end
  
    section
    |&gt; Map.put("lessons", lessons)
    |&gt; Map.put("position", section_counter)
  end
end
</code></pre>
<p>Okay I suppose. I like the <code>mut</code> more because combined with <code>=</code> it’s more explicit that it belongs to the current scope.</p>
<p>FWIW I think <code>@@</code> seems noisy/distracting and detracts from the proposal of cleaner/readability. Of course, I am ignorant on how the parsing/AST needs to be modified, so I understand it may be chosen out of necessity.</p>
<p>But if I had to choose between <code>@@</code> and nothing, I would choose nothing and have the syntax highlighting underline as shown above <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"> If it was only 1 special symbol it would look a lot better. I would love <code>&amp;</code> if it was possible with the parser. A fun convention is <code>*earmuffs*</code> from lisp</p>
<p>The only con with the “underline” approach is when sharing code in a context that does not highlight it, like github snippets, But that’s it.</p>
<p>Overall, this proposal helps toward the end goal of Maintainability as it reduces noise and allows one to write the algorithm like how they’d say it out loud without having to “convert” it to functional paradigm</p>
<p>Easier to work with than worrying about rebindings or tracking down how data flows through recursive function pattern matching <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="310374" 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/local-accumulators-for-cleaner-comprehensions/60130/165">Post #164</a>
	                </div>
	            </div>
              <div id="likers-container-310374" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310374"
                     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 #164"></div>
  </section>
</div>
    <div class="postbit" id="310376" data-post-id="310376">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="17" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>It actually isn’t mutable state. Think of it as a more implicit version of the pipe operator where data is threaded in more complex ways. It doesn’t take away from your other concerns, but we should be clear it isn’t actually mutable.</p>
</blockquote>
</aside>
<p>Given the above, there must be better options than using <strong>mut</strong> or <strong>mutable</strong> as a keyword.</p>
<p>(This debate has been pretty impressive!)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310376" 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/local-accumulators-for-cleaner-comprehensions/60130/166">Post #165</a>
	                </div>
	            </div>
              <div id="likers-container-310376" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310376"
                     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 #165"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/60130/load_more?page=17">Load more posts (85 remaining)</a>
</div></template></turbo-stream>