<p dir="auto">It's often useful to avoid duplicate work by performing an assignment at the same time as evaluating a condition, i.e.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if (val = expensive()) != nothing
  val
else ..."><pre class="notranslate"><span class="pl-k">if</span> (val <span class="pl-k">=</span> <span class="pl-c1">expensive</span>()) <span class="pl-k">!=</span> <span class="pl-c1">nothing</span>
  val
<span class="pl-k">else</span> <span class="pl-k">...</span></pre></div>
<p dir="auto">If a function predicate is used, this is parsed as a keyword argument and throws an error:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if isvalid(true, (val = expensive()))
  ...
else ..."><pre class="notranslate"><span class="pl-k">if</span> <span class="pl-c1">isvalid</span>(<span class="pl-c1">true</span>, (val <span class="pl-k">=</span> <span class="pl-c1">expensive</span>()))
  <span class="pl-k">...</span>
<span class="pl-k">else</span> <span class="pl-k">...</span></pre></div>
<p dir="auto">Assignments inside brackets are special cased when using <code class="notranslate">&amp;&amp;</code>, <code class="notranslate">||</code> etc., it might be useful if they were here, too. <code class="notranslate">name = val</code> would be a keyword argument but <code class="notranslate">(name = val)</code> would be a regular assignment.</p>
<p dir="auto">I just learned about the keyword <code class="notranslate">outer</code> today. It would be nice if it had a docstring, and perhaps also if similar words (<code class="notranslate">local</code>, <code class="notranslate">global</code>) contained a "see also" link to <code class="notranslate">outer</code>.</p>