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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just want to give my 2 cents and say that I really like the <code>accum</code> block, it forces me to explicitly scope and declare the “mutable” variables upfront, and make it really clear where its happening. On top of that a tool like Credo could be configured to emit warnings when the block is too complex or big (to be fair any other of the proposed solutions could be checked by Credo, but I think that the <code>accum</code> block feels more “natural”).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310261" 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/147">Post #146</a>
	                </div>
	            </div>
              <div id="likers-container-310261" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310261"
                     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 #146"></div>
  </section>
</div>
    <div class="postbit" id="310279" data-post-id="310279">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I strongly dislike that we need to write the name of the variable differently. There is nothing intrinsically different to the variable itself. We just want a different assignment that says “don’t create a new variable in a local scope, but instead rebind the outer scope one”.</p>
<p>For example I can think of code that needs to be refactored, and suddenly a particular variable needs to be reassigned this way. We then have to change all existing instances of <code>my_var</code> and change them to <code>@@my_var</code>? I strongly dislike that idea. Or if we no longer needs to rebind a variable this way, then we suddenly should rename all <code>@@my_var</code> to <code>my_var</code> (would the compiler warn otherwise?).</p>
<p>I’m in favor of a special operator like <code>&lt;~</code>. The fact that there is no way to specify this for pattern match shouldn’t make this a no-go. We can always pattern match on a temporary variable, and then <code>my_var &lt;~ my_temporary_var</code> if need be.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310279" 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/148">Post #147</a>
	                </div>
	            </div>
              <div id="likers-container-310279" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310279"
                     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 #147"></div>
  </section>
</div>
    <div class="postbit" id="310285" data-post-id="310285">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m strongly in favor of current proposal and think this one is the best proposal among the other many similar, but I’d also favor any other proposal attacking the same problem.</p>
<p>I work with nested structures every day and one of the main pains I have is having to write nested reducers, which adds nesting levels, pollutes everything. Naming the reducers/splitting in functions just adds indirection. The code doesn’t get any better bc the accumulation we’re doing usually doesn’t have any name more natural than <code>maybe_add_value_to_acc</code>. If you’re doing this over two or more levels of nesting, you’ll need two artificial names like this.</p>
<p>Another problem the proposal solves is when you have multiple accumulators, you need to be passing a tuple of 3, possibly more elements everywhere, even when often you need to update just one of them. Instead of placing the emphasis on the only accumulator being updated, I need to bother naming each of them in the tuple. This creates some maintenance problems. If you need to change the structure of an accumulator, or add another one, it’s very easy to introduce errors since the language is dynamically typed. If you’re doing, say <code>reduce_while</code>, errors may go unnoticed until a less common case appears.</p>
<p>All these examples could be easily solved with the current proposal. It helps writing this sort of code with way less boilerprate and without adding anonymous or named functions that only introduce noise to the code and don’t help with clarity.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310285" data-batch-url="/posts/batch_likers">
                        18
                      </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/149">Post #148</a>
	                </div>
	            </div>
              <div id="likers-container-310285" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310285"
                     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 #148"></div>
  </section>
</div>
    <div class="postbit" id="310286" data-post-id="310286">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Kurisu" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Kurisu/120/14820_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Kurisu
                  </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="95" 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>A compromise would be a block:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">accum session_counter &lt;- 0, lesson_counter &lt;- 0 do
  ...
end
</code></pre>
<p>It has benefits from both approaches:</p>
<ol>
<li>The block helps limit the scope of where the variables are used, so we worry less about large functions</li>
<li>No additional syntax noise such as <code>@@</code> (although that can be a cons as usage is less clear)</li>
</ol>
<p>It also helps keep the theme that all of <code>for</code>, <code>with</code>, and then <code>accum</code> are actually monads (but let’s not call them that <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>
</blockquote>
</aside>
<p>Maybe you should update the initial post of this proposal thread with this, for the newcomers? I think this seems to suit most of the speakers in this discussion.</p>
<p>I’m also all for it as well, if it counts. ^^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310286" data-batch-url="/posts/batch_likers">
                        9
                      </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/150">Post #149</a>
	                </div>
	            </div>
              <div id="likers-container-310286" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310286"
                     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 #149"></div>
  </section>
</div>
    <div class="postbit" id="310287" data-post-id="310287">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="olivermt" data-post="131" 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/olivermt/48/2354_2.png" class="avatar"> olivermt:</div>
<blockquote>
<p>If you work with system or web dev you do the occasional Enum spaghetti wrangling which is fine. If you work in Livebook all day as a data scientist you do this all day all week.</p>
</blockquote>
</aside>
<p>I would counter that if your argument is that this would be mainly useful for a specific niche then you have argued against adding new syntax and for solving the problem in a library.</p>
<p>I also don’t believe I’ve seen any arguments in this thread that wouldn’t be “pragmatic.” Pragmatism is about favoring methods/solutions that have been proven to work vs ones that conform with a systematic vision. I think the problem is clear the only debate (it seems to me) is whether the solution would be <em>practically</em> beneficial enough to justify the addition to the API.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310287" 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/151">Post #150</a>
	                </div>
	            </div>
              <div id="likers-container-310287" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310287"
                     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 #150"></div>
  </section>
</div>
    <div class="postbit" id="310288" data-post-id="310288">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is a really good take.  I certainly don’t have to write nested reducers daily so ya, I haven’t felt that pain (for context I lean on the side of disliking the proposal though I do really like the block idea).  As a bit of a side note (ie, not meant as a rebuttal to your feedback) when I do end up in nested reducers, I very much lean into Elixir being a LISP 2 and keep the same names going down.  It’s probably an unpopular choice, but this avoids having to come up with throwaway names and it’s not nearly as confusing as I initially thought it would be when I first started trying it out.  YMMV, of course.  Again, I don’t write nearly as many as you do.</p>
<aside class="quote no-group" data-username="marcandre" data-post="148" 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/marcandre/48/31790_2.png" class="avatar"> marcandre:</div>
<blockquote>
<p>For example I can think of code that needs to be refactored, and suddenly a particular variable needs to be reassigned this way. We then have to change all existing instances of <code>my_var</code> and change them to <code>@@my_var</code>? I strongly dislike that idea. Or if we no longer needs to rebind a variable this way, then we suddenly should rename all <code>@@my_var</code> to <code>my_var</code> (would the compiler warn otherwise?).</p>
</blockquote>
</aside>
<p>I think José is leaning away from <code>@@</code> based on a comment I’m too lazy to scroll up to find.  I feel you on this but I would also say in opposition that not having some sort of special syntax hurts scannability.  If there is a bunch of code long enough that refactoring out this syntax would be a pain, then having syntax to call these special bindings out is a huge help when reading unfamiliar code very quickly.  I’m very much in support of the block solution without any form of special syntax.  My thought there is that people are far less likely to write very long blocks, but of course it’s still possible, but it at least keeps the definition of these bindings in one spot.</p>
<p>Actually, that just made me think… would the hypothetical <code>accum</code> blocks be nestable??</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310288" 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/152">Post #151</a>
	                </div>
	            </div>
              <div id="likers-container-310288" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310288"
                     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 #151"></div>
  </section>
</div>
    <div class="postbit" id="310289" data-post-id="310289">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>First of all, thanks Jose for asking the community.</p>
<p>I haven’t really felt the need for such proposal and if you need less code, there’s always the solution of using the process dictionary (even if it’s a bad habit).</p>
<p>The introduction of “with” to refactor error handling was for me a much more useful feature and it’s no surprise the equivalent has been added later in erlang.</p>
<p>I’m not fond of the initial proposal. Although it’s elegant, I fear like others that people will abuse it and write @<span class="mention">@my_var</span> everywhere, even for variables that are not actually used as local accumulators.</p>
<p>I prefer the accum block solution as well.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310289" data-batch-url="/posts/batch_likers">
                        6
                      </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/153">Post #152</a>
	                </div>
	            </div>
              <div id="likers-container-310289" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310289"
                     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 #152"></div>
  </section>
</div>
    <div class="postbit" id="310293" data-post-id="310293">
  <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>As a relative newcomer to the elixir community, I support the block based approach as well since it maps more to the macro definitions of for and if, but I can’t help but feel like the expressiveness of each approach is flawed.</p>
<p>In the @@ case, it looks like a module attribute, as a beginner I mentally mapped @ “this is most effective at constants because I see this all the time with constant string values or constant integer values” (see phx.gen.auth for my first real exposure). I understand now what the difference would be, but I didn’t personally see @ and think accumulating values, I think that behavior is mostly only relevant in macro definitions or dsls?</p>
<p>For the block scope, it’s definitely a bit more of what I’d expect for elixir but then you’d hit the case perhaps described better by others, where it’s not obvious that <em>this</em> name behaves differently. Might be misunderstanding the internals of the block but if it’s what I think it is, which is that the name passed into the block can be rebound at will, then that would not be ideal because of the inconsistency I believe it might introduce, there’s nothing more complicated while learning than something is special cased.</p>
<p>While I hung up my js hat a while ago and it’s been a bit of a slog to read through all the threads, I can’t help but think that <code>let</code> better communicates the semantics that are required here, which is that a value is bound to a name and can be rebound at will. Now obviously that opens up a can of worms such as scoping rules and “why do I have let but no const” but just thought I’d throw my small bit of opinion in there.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310293" 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/154">Post #153</a>
	                </div>
	            </div>
              <div id="likers-container-310293" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310293"
                     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 #153"></div>
  </section>
</div>
    <div class="postbit" id="310297" data-post-id="310297">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ducharmemp" data-post="154" 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/ducharmemp/48/32121_2.png" class="avatar"> ducharmemp:</div>
<blockquote>
<p>While I hung up my js hat a while ago and it’s been a bit of a slog to read through all the threads, I can’t help but think that <code>let</code> better communicates the semantics that are required here, which is that a value is bound to a name and can be rebound at will. Now obviously that opens up a can of worms such as scoping rules and “why do I have let but no const” but just thought I’d throw my small bit of opinion in there.</p>
</blockquote>
</aside>
<p><code>let</code> expressions are common in functional languages and they don’t allow for rebinding (at least none of the ones I’m familiar with do), so JavaScript shouldn’t really be looked to for compression here.  And of course, the whole beauty of Elixir is that all bindings are constant.  It would be better to compare to Rust where <code>let</code> is immutable but <code>let mut</code> is mutable, in Elixir’s hypothetical case we could say that <code>let</code> is just <code>mut</code> in an otherwise keywordless declaration… uhhhhhhhhh, I’m starting to confuse myself.  Hopefully we just don’t use <code>let</code> <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">  Especially because we now have <code>:let</code> in heex which has nothing to do with “immutability.”</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310297" data-batch-url="/posts/batch_likers">
                        6
                      </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/155">Post #154</a>
	                </div>
	            </div>
              <div id="likers-container-310297" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310297"
                     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 #154"></div>
  </section>
</div>
    <div class="postbit" id="310298" data-post-id="310298">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Similar to <a class="mention" href="/u/jeregrine" rel="nofollow">@jeregrine</a>, I am strongly in favor of adding local accumulators to Elixir as described here, but I have one question: would it be possible to emit a compilation warning when using local accumulators that are never reassigned? That way developers new to Elixir (or local accumulators) would receive guidance for when they don’t need to add the leading <code>@@</code> to their variables.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310298" data-batch-url="/posts/batch_likers">
                        7
                      </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/156">Post #155</a>
	                </div>
	            </div>
              <div id="likers-container-310298" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310298"
                     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 #155"></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=16">Load more posts (95 remaining)</a>
</div></template></turbo-stream>