title: Is there a short circuit 'or' that returns the first 'true' value?
body: <p>Scheme has a short-circuiting <code>or</code> that will return the first non-false value:</p>
  
  <pre><code>&gt; (or 10 20 30)
  10
  &gt; (or #f 20 30)
  20
  &gt; (or #f)
  #f
  </code></pre>
  
  <p>It does not evaluate its arguments until needed.</p>
  
  <p>Is there something like this already in PowerShell?</p>
  
  <p>Here's an approximation of it:</p>
  
  <pre><code>function or ()
  {
      foreach ($arg in $args) {
          $val = &amp; $arg; if ($val) { $val; break }
      }
  }
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>PS C:\&gt; or { 10 } { 20 } { 30 }
  10
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>PS C:\&gt; $abc = $null
  
  PS C:\&gt; or { $abc } { 123 }
  123
  
  PS C:\&gt; $abc = 456
  
  PS C:\&gt; or { $abc } { 123 }
  456
  </code></pre>