title: Is "with" Within Elixir a New Scope?
body: <p>I'm guessing that within a <code>with</code> in Elixir, any variables in the block are local to the block.  I made this code to test my assumption:</p>
  <pre><code>defmodule T do
    def test do
      r1 = nil
      r2 = nil
  
      with(
        r1 &lt;- Enum.find([9], &amp;(&amp;1 &gt;= 9)),
        r2 &lt;- Enum.find([2], &amp;(&amp;1 &lt;= 2))
      ) do
      end
  
      IO.write(&quot;r1 is nil is #{is_nil(r1)}, r2 is nil is #{is_nil(r2)}&quot;)
    end
  end
  </code></pre>
  <p>And as expected, <code>r1</code> and <code>r2</code> are <code>nil</code>.</p>
  <p>Is there any way to check the bound values outside of the scope of the <code>with</code> or is that just the way it works?  I am asking because I was running some <code>Enum.finds</code> against an Enumerable and it'd be nice to be able to distinguish which one failed outside of the with block.</p>