is is such a common pattern, Janet has a macro for this exact purpose.
The <code class="mendoza-code">(for x start end body)</code> form captures this behavior of incrementing a
counter in a loop.
</p>
<pre class="mendoza-codeblock"><code data-language="janet">(<span class="mdzsyn-coresym">var</span> <span class="mdzsyn-coresym">sum</span> <span class="mdzsyn-number">0</span>)
(<span class="mdzsyn-coresym">for</span> <span class="mdzsyn-symbol">i</span> <span class="mdzsyn-number">0</span> <span class="mdzs